PDA

View Full Version : selecting last object. ie importd obj


stallion151
11-11-2005, 03:06 AM
hey,

is there a way to select the newly imported object....when you import an object it by default isn't selected. want to know if there is a way to do this.
At the moment the script we have queries everything in the scene and finds the odd one out. I didn't write it, but it is painfully slow on large scenes. Which are all our scenes.

Is it possible to search the scene being imported for the object. as there is usually only one object/group being imported and get that name for the master scene...so it doesn't have to search for it?

If there is another way please let me know

john_homer
11-11-2005, 03:52 AM
if the script you have is slow, then it is probably comparing every node in the scene,which is not that smart since imported objects are always inported to the top level (parent of the world)... so you really only need to compare them...


either..

look into the script for the line that list everything (will look like string $allThings = `ls`) and replace the `ls` with `ls -as`

it will do that twice...


or..

poste the script and I'll do it.

or...

just import with nameSpace, than list stuff inthe sameSpace, then remove it from the nameSpace..
be careFull, nameSpaces are a bit of a pain if you dont keep ontop of them... and the help isn't soo good ;)

.j

Segmoria
11-11-2005, 02:14 PM
Isn't there any "import" related condition/event that you could use with a scriptjob?

stallion151
11-13-2005, 10:29 PM
thanks guys...i asked the melScripter here at work, and he'll look at fixing this one. Likely using the nameSpace ooption like John suggested..

thanks fellas.

stallion151
11-14-2005, 07:29 AM
the extra flag -as worked very well. in one test i did took only four seconds compared to 77sec...almost 20x faster.
thats good for me.

thanks john.

CGTalk Moderation
11-14-2005, 07:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.