Notifications
Clear all

[Closed] Set visibility to 0.5

I want to run a command that sets the “visibility” value to 0.5
Unfortunately without success. I tried to set the visiblity value of selected object to 0.5 using the command

selObj.visibility = 0.5
and
$.visibility = 0.5

But this make my object always 0% opacity.
I read that it is not possible to set the transparency of an object to a specific value because 3ds max distinguishes only true / false
Is there any other way to do this?

5 Replies

$.visibility.controller.value = 0.5

Thanks for your answer. Can you tell me how can i load this command into my script ?
for selObj in selection do (

    if selObj.primaryVisibility == false then
    
    (
    
		       selObj.visibility = 0.5
        
    )
	else
	
	(
    
		       selObj.visibility = 1
        
    )
)

Do I need to add any additional controller?

for o in selection do 
(
	try o.visibility.controller catch o.visibility = bezier_float()
	if o.primaryVisibility then o.visibility.controller.value = 1 else o.visibility.controller.value = 0.5 
)

Like for you works great. I have one more question. Czn you explain me what is and what do bezier_float() in the code ?

any property definited by a kind of controller , bezier_float is main controller for float numerical control , object’s pos / rotation are default to it
the code add the bezier_float controller to visibility property