ScriptSpot home

Forum topic · General Scripting

CollapseNodeTo works every second execution.

By dimwalker · 2008-07-02

Description

Have selected EP object, trying to assign UnwrapUVW and then collapseTo the stack.
For some strange reason Unwrap modifier stays 1st time I run the script and gets killed 2nd time.
Same code work like a charm if executed line-by-line, another thing that bugs me is that CollapseNodeTo returns "true" even if it failed.

Here is the code:


addModifier $ (Unwrap_UVW ())
maxOps.CollapseNodeTo $ 1 off

What am I doing wrong?

Comments (3)
dimwalker

I need CollapseNodeTo to keep instances.

Right now I'm using workaround suggested by IN_Human
-create node(tempnode)
-copy baseobject from source object to tempnode
-store baseobject of source object for later comparison
-make all stack operation on tempnode and collapse it (CollapseNode)
-copy baseobject back, from tempnode to source object
-cycle through all object and compare its baseobject to previously stored baseobject, if it matches(an instance of source object), then copy tempnode baseobject to this object too

Jenne van der Meer

since your collapsing to the 1st modifier in the stack just a simple:

maxOps.CollapseNode $ true
--Would do fine as tested with 100 objects using:
for obj in geometry do maxOps.CollapseNode obj true

Cheers

flyingc

it seems that the results is same for evevry type object that can converttomesh