The sequence of lines does not work
Hello
I have a problem with enabling and disabling the same operation using Railclone's example.
Using the example of this code, it is necessary for the geometry to be displayed in the viewport, but the auto update checkbox was disabled.
Example:
viewArr=(for obj in objects where classof obj.baseObject==RailClone_Pro and not obj.isHiddenInVpt collect obj) for i in viewArr as array do ( i.autoUpdate=on i.disabled=off ) for i in viewArr as array do ( i.autoUpdate=off )
When adding code to an interface, the operation is not complete. Geometry is not displayed in the viewport.
Example:
on btn_1 pressed do ( viewArr=(for obj in objects where classof obj.baseObject==RailClone_Pro and not obj.isHiddenInVpt collect obj) for i in viewArr as array do ( i.autoUpdate=on i.disabled=off ) for i in viewArr as array do ( i.autoUpdate=off ) )
The sequence of lines does not work:
i.autoUpdate=on i.autoUpdate=off
What could be the problem?
Any help appreciated.
Comments
A similar problem
It looks like the problem occurs when enabling/disabling the same operation in one action.
Here is an example of vertical alignment of the camera:
When we need to enable/disable "Auto guess vert tilt" in one action and get as a result the generation of numbers for "Vertical tilt"
In this code, the last line will be executed, the first will be skipped.
Any ideas how to get around this?
.
Why do you use two for loops?
I don't have railClone, but try this:
Tools and Scripts for Autodesk 3dsMax
Does not work
With a single loop, geometry generation in the viewport is skipped.
Also in my scene there is a large number of RailClone and to choose each one does not suit me.