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.

sag_instancerToGeometry Interface

Usage:

from sag_instancerToGeometry import *
sag_instancerToGeometry()

Options:

Make Duplicates/Instancesin 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 Frameif 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 Rangein 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...]

Helplink to this page.

Notes:

Of course, there’re some limitations and arrears… Right now I can list these:

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]>>;

So, try it, use it and send me bugReports/toDo’s – I’ll try to correct/implement them.

Several Instancers Converted into Geometry Simultaneously

Several Instancers Converted into Geometry Simultaneously

21 Responses to “Convert Instancer into geometry”

  1. leo369 - November 17, 2009

    hello,friend,can you send python script to me
    mail:yuyu8401936@hotmail.com

  2. Владимир - November 23, 2009

    Отличная утилита!!!

  3. Dan Shumaker - June 11, 2010

    I’m getting a “Bad Magic Number” error when trying to import.

    Can you send me the script please? dans@floathybrid.com

    Thanks.

  4. Sagroth - June 11, 2010

    I’ve put original .py instead of compiled .pyc, so there should be no issues anymore.

    Положил исходный .py вместо скомпилированного .pyc, поэтому проблем больше не должно быть.

  5. Mostafa - June 23, 2010

    this is awesome man. thanks a lot.

  6. sanctus - August 6, 2010

    Возможно вас заинтересует http://somesanctus.blogspot.com/2010/08/smartrotation.html
    и вы пересмотрите свое отношение к каналам Aim и Up
    это – пожелание включить их в утилитую.

  7. Sagroth - August 6, 2010

    Да, спасибо. Я в курсе что это нужно и важно, просто пока не успел обдумать как это все конвертить во вращения.

  8. Knekker - November 26, 2010

    Whenever i try to source this script I keep getting a // Error: invalid directive // I’ve tried putting the script in every script folder there is in maya. What am i doing wrong? I use maya 2010 btw.

  9. Sagroth - November 26, 2010

    Have you tried the latest .py version? I heard old .pyc caused problems on different OSes, so I’ve put .py eventually.

  10. knekker - November 26, 2010

    Hey thanks for the quick reply, i figured out the problem, In the script editor i forgot to choose the Python menu before loading the script.

    Now I have loaded the script with no errors, it seems to have loaded just fine, now my question is… Shouldn’t there apear a GUI box whenever i load this script? cause nothing happens.

    Am i missing a step or something? Pardon my noobness, I’ve never loaded a python script before.

  11. knekker - November 26, 2010

    Oh I forgot to mention that after i loaded the script I ran the “from sag_instancerToGeometry import *
    sag_instancerToGeometry()” lines, and a GUI box apears, but it only contains “Start from Current Frame” button.

    We are running linux here at the company, perhaps thats the reason, rest of the GUI is missing?

  12. knekker - November 26, 2010

    well I guess you could just delete my posts, I got it to work now for some odd reason. = /

    Thanks for the help btw.

  13. knekker - November 26, 2010

    This tool is really neat at creating objects that translates along with the instanced objects, my question now is… it is possible for it to simulate the rotation of each instanced object/particle as well?

  14. Sagroth - November 26, 2010

    Good that everything is working eventually.

    Script bakes rotations, but from ‘Rotation’ channel only – no aims. There’s a mention about that in notes above. So, if you have it mapped – everything should be fine, if you use aims – you should try to convert them into rotations for baking or rotate baked objects afterward.

  15. knekker - November 29, 2010

    Alright thanks alot for the tip Sagroth, very appreciated.

  16. Yaleh - December 15, 2010

    Love the script. Thanks for putting it out there!

  17. gardenia - January 28, 2011

    Your script works beautifully. Thank you so much for making it available. I very often have to create instances on a surface which is the goal of the particles. The instances Aim Direction is connected to Goal World Normal 0 PP so that they get oriented along the surface normal. Is there a way to transfer the instances orientation to the Rotation channel so that your script evaluates it?

    Thank you!

  18. Sagroth - January 28, 2011

    Yeap, you just need to use your goalWorldNormal0PP instead of velocity in the angleBetween formula I wrote above. And I think goalWorldNormal0PP won’t get generated at birth, so put this script into runtime expression instead of creation.

  19. gardenia - January 31, 2011

    Thanks so much Sagroth. It works great!!

  20. Daniel - February 28, 2011

    Thanks a lot, It saved me quite a lot of time today :)

  21. Malek - April 21, 2011

    you are a great person!!!

Leave a Reply