Jump to content
Sign in to follow this  
avak

evaluating display flag in OBJ level

Recommended Posts

Hi,

I know how to check display flag in sop level by python, but how can I do in obj level

I want to write something like this so it checks box 1 display status and apply that status to box 2,

import hou
box1 = hou.node('/obj/box1')
box2 = hou.node('/obj/box2')
box1.setDisplayFlag("EVALUATE DISPLAY FLAG OF BOX2")

 

image.thumb.png.c1c1256349fb6940fabbf8b365e26d6a.png

Edited by avak

Share this post


Link to post
Share on other sites

In almost all coding languages, a "flag" is considered to be a boolean value, or an integer that is 1 or 0.

Try passing a number instead of a string.

box2.setDisplayFlag(1)

 

Share this post


Link to post
Share on other sites

Thanks to replay, although I think I wasn't clear enough,

I know about boolean things (..at least:D )

but I want to know how to get the display flag status of a node  and store it's value in a variable then pass it to another node's display flag 

 

Share this post


Link to post
Share on other sites

I think you can use the companion get function for that.

import hou
box1 = hou.node('/obj/box1')
box2 = hou.node('/obj/box2')
box1.setDisplayFlag(box2.getDisplayFlag()) 

 

Share this post


Link to post
Share on other sites

Thats exactly my problem, I get this error

 The attempted operation failed.
Traceback (most recent call last):
  File "hou.session", line 4, in <module>
AttributeError: 'ObjNode' object has no attribute 'getDisplayFlag'

Share this post


Link to post
Share on other sites

the interesting part is we can use setDisplayFlag but we don't have something to getDisplayFlag and thats where I stuck

Edited by avak

Share this post


Link to post
Share on other sites

Hi avak !

I suggest you to look at the documentation page for the ObjNode

If you search for "display" in the page, you'll see that indeed, "getDisplayFlag" doesn't exist
Instead, it is called isDisplayFlagSet

displayFlag.gif.15f15c6dc2ccc0ef796cbd0da2814977.gif

Hope that helps !

Edited by Alain2131

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×