|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
|
How to create toggle buttons, like this ex. I want to in 1st click = runs command [A], on 2nd click = runs command [B] and on 3rd click = back up to 1st click command? How this script code looks in VBScript?
|
|
|
|
Heey 45 views, and no answers :( I want only to create button toolbar, where on first mousebotton click is runing script [A], second click runs script [B] and next click back to Script [A], I want only to create a toggle botton. Is it so difficult? :(
|
|
|
|
My best guess would be so-called “Radio Buttons"…
XSI SDK Documentation:
Customizing with the SDK > Custom Properties > Property Page Controls > Enum Controls > Radio Buttons
The “other” Softimage community: si-community.com
|
|
|
|
You could use global variables
[SIZE=2][SIZE=2]bHitOnce = getglobal("bHitOnceGlobal")[/SIZE]
[SIZE=2]if bHitOnce = true then[/SIZE]
[SIZE=2] logmessage "Second time"[/SIZE]
[SIZE=2] setglobal "bHitOnceGlobal" , null [/SIZE]
[SIZE=2]else[/SIZE]
[SIZE=2] logmessage "First time"[/SIZE]
[SIZE=2] setglobal "bHitOnceGlobal" , True [/SIZE]
[SIZE=2]end if[/SIZE]
[/SIZE]
|
|
|
|
[B]SebasProulx[/B] Can you wrote me a code, that on first click do = SetValue “Camera.camvis.objctrllattices”, False and on Second = SetValue “Camera.camvis.objctrllattices”, False with your global variables?
|
|
|
|
You mean false and true?
For that , you don’t need global variables. You already have the information if the lattices are visible. You juste need to get that information with “getvalue”
Tell me exactly what you need to do.
|
|
|
|
For example I want to: For first click [I]CreatePrim “Cube”, “MeshSurface"[/I], on Second click [I]CreatePrim “Sphere”, “MeshSurface"[/I] and on next goto first click. It does not matter what the script, тthe main I want to see how the code looks. Thanks
|
|
|
|
In that case, you just need to replace the logmessage by anything you want to do.
Juste make sure you use a unique global variable in each one of your script.
But you should use global variables only when you have no other choice. If there is a way to know the state of the thing you want to change, then go get if and make a “if statment” with that.
ex:
[SIZE=2]
blatticeVisible = getvalue( "Camera.camvis.objctrllattices")
if blatticeVisible = true then
SetValue "Camera.camvis.objctrllattices", False
else
SetValue "Camera.camvis.objctrllattices", true
end if
[/SIZE]
|
|
|
|
Ooo thank you so match ;) And can not only a one stroke, for ex:
blatticeVisible = getvalue( “Camera.camvis.objctrllattices”, “Camera.camvis.objnulls")
if blatticeVisible = true then
SetValue “Camera.camvis.objctrllattices”, “Camera.camvis.objnulls”, False
else
SetValue “Camera.camvis.objctrllattices”, “Camera.camvis.objnulls”, true
end if
I try to do this, kind of script it brings me this error:
‘ ERROR : 2012-EDIT-SetValue - Type mismatch
SetValue “Camera.camvis.objctrllattices”, “Camera.camvis.objnulls”, True
‘ ERROR : Type mismatch: ‘SetValue’ - [line 7]
‘ ERROR : (Microsoft VBScript runtime error)
‘ ERROR : [5] else
‘ ERROR : [6]
‘ ERROR : >[7] SetValue “Camera.camvis.objctrllattices”, “Camera.camvis.objnulls”, true
‘ ERROR : [8]
‘ ERROR : [9] end if
‘ ERROR : Type mismatch: ‘SetValue’
What is wrong there???
|
|
|
|
try :
SetValue “Camera.camvis.objctrllattices,Camera.camvis.objnulls”, True
|
|
|
|
| Settings
| Choose Theme color:
|
|
|
|
|
|
|
|
|