Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / Toggle buttons
  RSS 2.0 ATOM  

Toggle buttons
Rate this thread
 
30122
 
Permlink of this thread   Subscribe to this thread
avatar
  • Sosoyan
  • Posted: 19 October 2008 09:13 AM
  • Total Posts: 46
  • Joined: 19 February 2008 03:55 AM

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?



Replies: 0
avatar
  • Sosoyan
  • Posted: 20 October 2008 07:59 AM

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? :(



Replies: 0
avatar

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

Replies: 0
avatar

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]


Replies: 0
avatar
  • Sosoyan
  • Posted: 20 October 2008 08:49 AM

[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?



Replies: 0
avatar

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.



Replies: 0
avatar
  • Sosoyan
  • Posted: 20 October 2008 09:02 AM

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



Replies: 0
avatar

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]


Replies: 0
avatar
  • Sosoyan
  • Posted: 20 October 2008 09:16 AM

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???



Replies: 0
avatar

try :

SetValue “Camera.camvis.objctrllattices,Camera.camvis.objnulls”, True



Replies: 0




   
  Settings Choose Theme color: