Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Maxunderground news unavailable

MaxScript: Check if Visibility track exists?
show user profile  Stianbl
Quick question:

I want to create a "fade in" and "fade out" button, which adds a visibility track to selected objects and either fade them in or out at the given time.

Works great so far, except when I want to do "fade in", and later "fade out" on the same object.
As of now, I do "o.visibility = bezier_float()" on each object, and if the track is already a bezier_float then the previous keys gets moved from 0, 1 to -1, 0

How do I do a simple check to see if there already exists a visibility track for the given object?
Also, any way to delete the visibility track of an object with maxscript?

Thanks in advance,
Stian :)

read 1223 times
2/20/2014 5:43:09 PM (last edit: 2/20/2014 5:43:09 PM)
show user profile  Stianbl
Had to do a try catch for now.
It's strange to code without all the brackets!^^

print "Controller exists!"
print "No Controller exists. Creating new..!"
o.visibility = bezier_float()

But I'd like to know how I can delete the visibility track. :)

read 1219 times
2/20/2014 6:38:31 PM (last edit: 2/20/2014 6:42:43 PM)
show user profile  Mr.Burns
For a selected object:

if GetVisController $ == undefined then
$.Visibility = Bezier_Float()

And deleting:

$.Visibility = undefined
$.Visibility = true

If you leave out the second line your object may be invisible.
read 1209 times
2/20/2014 7:04:56 PM (last edit: 2/20/2014 7:05:22 PM)
show user profile  Stianbl
Thanks! I find the F1 help to be quite messy. Probably just me, but I cant find much help there :P Not sure what to search for either ^^ hehe

But thanks! :)

read 1192 times
2/21/2014 10:34:50 AM (last edit: 2/21/2014 10:34:50 AM)
show user profile  Mr.Burns
It's one bjg unusable mess, but most of the time I somehow manage to extract the information I need ;)
read 1182 times
2/21/2014 4:51:36 PM (last edit: 2/21/2014 4:51:36 PM)
show user profile  FX
It still works ;) thanks :p
read 239 times
2/22/2017 11:04:35 PM (last edit: 2/22/2017 11:04:35 PM)
#Maxforums IRC
Open chat window