Prefix the name of the mirrored copy of an object

Next
 From:  krass
7410.1 
Dear Michael, the question is: is it possible to somehow make when mirroring an object having its own name, to the object-reflection to automatically add a prefix to his name?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7410.2 In reply to 7410.1 
Hi krass,

> Dear Michael, the question is: is it possible to somehow make when mirroring an object
> having its own name, to the object-reflection to automatically add a prefix to his name?

Yes, this is possible to set up by modifying the Mirror.js command script file to do some extra processing before it finishes.

To make the modification you will need to edit the file Mirror.js with a text editor, the file is located in the commands folder. On Windows that will be at: C:\Program Files (x86)\MoI 3.0\commands , on Mac right-click the .app icon and choose "Show package contents" and inside there go to drive_c/moi/commands .

Then to make the special prefixed renaming happen, insert the code below into the file right before the call to factory.commit() near the end:


code:
	if ( !GetPoint( pointpicker ) )
		return;

	// Start of new added code.	
	var inputs = factory.getInputObjects();
	var outputs = factory.getCreatedObjects();
	if ( inputs.length == outputs.length )
	{
		for ( var i = 0; i < inputs.length; ++i )
		{
			var inputobj = inputs.item(i);
			var outputobj = outputs.item(i);
			
			if ( inputobj.name != '' )
			{
				outputobj.name = 'prefix_' + inputobj.name;			
			}
		}
	}
	// End of new added code.
	
		
	factory.commit();


Hope this helps! - Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  krass
7410.3 In reply to 7410.2 
Thank you, Michael, I will try. It applies to version 2.0 as well?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7410.4 In reply to 7410.3 
Hi krass, sorry no I don't think it will work in v2.0 , it uses some script methods that were new in v3.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
7410.5 
Have you an example of the result of this ?
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  krass
7410.6 In reply to 7410.4 
It is a pity that only 3 versions. )
Do not get to test.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All