Jump to content

How to set Parameter Visibilities in OIP


Recommended Posts

I'm trying to set parameter visibility in the object info panel.


In the old vector script I would retrieve the custom object information as follows:

result:= GetCustomObjectInfo(objname,oh,rh,wh);

I would then set the visibility of the parameter as follows:



In python I am trying to accomplish the same thing.

I've tried the following:

result = vs.GetCustomObjectInfo(objname,oh,rh,wh)

and then I attempted to set the visibility as follows:

vs.SetParameterVisibility(oh, 'parametername', FALSE)


when i run the script I get the following error:

NameError:  name 'objname' is not defined


Does anyone know how to accomplish this using best practice?






Link to comment

I have not assigned a value to objname.  I've created a plugin object and I need to reference and object handle to set the visibilities of the parameter.  how do i acquire or assign these?  

I thought using the following:


would have acquired and assigned these for me

Edited by MaxStudio
Link to comment

I've eliminated the vs.GetCustomObjectInfo(objname,oh,rh,wh) and just used vs.SetParameterVisibility(handle, 'parametername', FALSE)

I set the object handle to zero

vs.SetParameterVisibility(0, 'parametername', FALSE)


I want to use a pulldown to set the visibility to true:



if number == "2":

    vs.SetParameterVisibility(0, 'parametername', True )


but I'm getting the following error:


Error: Invalid callback function parameter type. Parameter index= 0 name=inPlugin

     File "<string>", line 38, in <module>

     File "<string>", line 1, in <module>


below is the actual code:


import vs
import shapes



vs.SetParameterVisibility(0, 'shape01', False )
vs.SetParameterVisibility(0, 'shape02', False )
vs.SetParameterVisibility(0, 'shape03', False )

if number == "2":

    vs.SetParameterVisibility(0, 'shape01', True )
    vs.SetParameterVisibility(0, 'shape02', True )

if number == "3":

    vs.SetParameterVisibility(0, 'shape01', True )
    vs.SetParameterVisibility(0, 'shape02', True )
    vs.SetParameterVisibility(0, 'shape03', True )





Link to comment


I should have read the documentation before I asked my question. 'objname' is returned by the function vs.GetCustomObjectInfo().


However, in Python, all returned variables must be to the left of the equal sign. Try this:


result, objname, oh, rh, wh = vs.GetCustomObjectInfo()


then use the handle "oh" in your vs.SetParameterVisibility() calls.




Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...