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
|