Convert Instancer into geometry
Type: Python Script (py)
Name: sag_instancerToGeometry
Version: 1.1
Released: 2010.06.11
Download
Almost every time I use instancer to duplicate geometry via particles, I inevitably want to convert it’s result into standard keyframed objects to modify or simply delete specific ones.
At last I’ve put myself together and have written a tool for this task.

Usage:
- put sag_instancerToGeometry.py into any Maya scripts folder;
- execute python-script:
from sag_instancerToGeometry import *
sag_instancerToGeometry()
- select instancer(s) you want to convert and press Convert button in tool’s window. Conversion, static channels deletion and application of euler filter will take place.
Options:
Make Duplicates/Instances – in the first case all created objects will be independent duplicates, in the second one – they will be instances of the original object (the one plugged into instancer);
Start from Current Frame – if enabled, no matter what playback range is set to and whether custom range is enabled or not, conversion will start from the current frame;
Playback/Custom Range – in the first case conversion framerange will be taken from playback range, in the second one – you can enter custom start/end frames;
Convert – [...this description was so long and intricate, that it was removed by the editor...]
Help – link to this page.
Notes:
Of course, there’re some limitations and arrears… Right now I can list these:
- rotations can be converted only from Rotation channel of instancer, Aim channels don’t get evaluated and right now I don’t think they will be at all, since the most often used orientation by velocity could be easily done via expression for the same Rotation channel, e.g.:
float $vel[] = velocity;
float $ang[] = `angleBetween -euler -v1 1 0 0 -v2 $vel[0] $vel[1] $vel[2]`;
rotPP = <<$ang[0], $ang[1], $ang[2]>>;
- if an instancer channel is mapped to a “weird” attribute, that can’t be easily read – script would fail. At this point I can’t imagine why anyone would want to do this, though during the tests I’ve encountered that someone had set Scale to Ramp Velocity and my tool couldn’t read it. Possibly some useful attributes can cause problems, but that’s what updates are for.
- for proper rotations with respect to different rotationOrder types, tool has to freeze rotate channels of objects plugged into instancer. As a result, if they are driven by animation curves or expressions, or just locked – script would fail. I don’t see any point in rotating these original objects instead of doing this rotations via particle attributes as it’s meant to be done, so I didn’t bother solving this issue.
So, try it, use it and send me bugReports/toDo’s – I’ll try to correct/implement them.


5 Responses to “Convert Instancer into geometry”
hello,friend,can you send python script to me
mail:yuyu8401936@hotmail.com
Отличная утилита!!!
I’m getting a “Bad Magic Number” error when trying to import.
Can you send me the script please? dans@floathybrid.com
Thanks.
I’ve put original .py instead of compiled .pyc, so there should be no issues anymore.
Положил исходный .py вместо скомпилированного .pyc, поэтому проблем больше не должно быть.
this is awesome man. thanks a lot.
Leave a Reply