avak Posted October 17, 2020 Share Posted October 17, 2020 (edited) 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") Edited October 17, 2020 by avak Quote Link to comment Share on other sites More sharing options...
Atom Posted October 18, 2020 Share Posted October 18, 2020 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) Quote Link to comment Share on other sites More sharing options...
avak Posted October 18, 2020 Author Share Posted October 18, 2020 Thanks to replay, although I think I wasn't clear enough, I know about boolean things (..at least ) 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 Quote Link to comment Share on other sites More sharing options...
Atom Posted October 18, 2020 Share Posted October 18, 2020 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()) Quote Link to comment Share on other sites More sharing options...
avak Posted October 18, 2020 Author Share Posted October 18, 2020 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' Quote Link to comment Share on other sites More sharing options...
avak Posted October 18, 2020 Author Share Posted October 18, 2020 (edited) the interesting part is we can use setDisplayFlag but we don't have something to getDisplayFlag and thats where I stuck Edited October 18, 2020 by avak Quote Link to comment Share on other sites More sharing options...
Alain2131 Posted October 19, 2020 Share Posted October 19, 2020 (edited) 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 Hope that helps ! Edited October 19, 2020 by Alain2131 Quote Link to comment Share on other sites More sharing options...
avak Posted October 19, 2020 Author Share Posted October 19, 2020 Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.