gizmo subanim access

Hi all, I have a problem with a script

This script does work :
if true then (
mybox = box()
myuvw = uvwmap maptype:4
addmodifier mybox myuvw
mymodifier = mybox.modifiers[1]
)
print mymodifier.gizmo.position

but this one doesn't work:
if true then (
mybox = box()
myuvw = uvwmap maptype:4
addmodifier mybox myuvw
mymodifier = mybox.modifiers[1]
print mymodifier.gizmo.position
)

So, why i can't access to gizmo properties in the if-condition... please help me!!!

Best regards

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

Just oposite first not works because your variable is in other level (between the bruckets). Second works. First can works only in this form (if you declare variable before "if-then-else" or "if-do" statement)

mymodifier = undefined
if true then 
(
    mybox = box()
    myuvw = uvwmap maptype:4
    addmodifier mybox myuvw
    mymodifier = mybox.modifiers[1]
)
print mymodifier.gizmo.position

bga

gaetup's picture

Thanks barigazy for your

Thanks barigazy for your quick reply but it's not opposite.
If you can try the both code, the first one works (even if 'mymodifier' is not declared before) and the second one doesn't work!!!
It seems i can't access to gizmo properties inside the if-then statement (or for loop or function)... I don't understand...

gaetup's picture

found

I found!!! but i don't understand.
The problem happens when the uvwmap is applied to the object inside the if-then statement... it seems i can't create/apply the modifier and transform the gizmo, both, inside the same statement. The issue is to apply the modifier in the if-then statement and modify it in a function... If someone knows what happens, i'd like to understand!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.