Guest Swann Posted April 23, 2010 Share Posted April 23, 2010 Hi, I want my asset to update some parameters when it's created with a help of OnCreated script menu. Problem is that hou.pwd() returns global node in this case. So how to acces parameters on freshly created instance ? And is there possibility to acces function stored in PythonModule from OnCreated script ? Big Thanks for any tips Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted April 23, 2010 Share Posted April 23, 2010 (edited) The case is, I want apply the same functionality like omsbind (but hou.selectorBindings is not implemented )and plug data into group slot but I can't acces this instance of asset when it's not fully created yet, so how to achieve this ? def userInput(): import toolutils sViewer = toolutils.sceneViewer() list = [] pointA = sViewer.selectGeometry('Select point A', use_existing_selection=False, geometry_types=(hou.geometryType.Points,)) list.append(str(pointA)) pointB = sViewer.selectGeometry('Select point B', use_existing_selection=False, geometry_types=(hou.geometryType.Points,)) list.append(str(pointB)) This gives me my points but how to pack them into group slots ? I know how to set parameter but I can't acces it without knowing how to call instance of this asset on creation. Edited April 23, 2010 by SWANN Quote Link to comment Share on other sites More sharing options...
graham Posted April 23, 2010 Share Posted April 23, 2010 (edited) All the Python event handler scripts/sections, OnCreated, OnInputChanged, OnNameChanged, etc have relevant information available in the kwargs dictionary. In the case of OnCreated it gives you the hou.Node of the instance, as well as an instance of the hou.NodeType for the node. You can then just call the PythonModule directly from that. node = kwargs['node'] node.hdaModule().foo(node) Edited April 23, 2010 by graham Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted April 23, 2010 Share Posted April 23, 2010 Eeeexactly what I was looking for, thank you very much. 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.