eunchae Posted April 2, 2020 Share Posted April 2, 2020 Hi. I would like to know the difference between using Python in the Python panel and the Houdini shelf tool. For example, I'm trying to use the drag and drop feature, but it doesn't work with the Houdini shelf tool. However, it is used in the Python panel. Is there a way to use drag and drop in the Houdini shelf tool? What I want is to drag and drop the node and enter the path in the blank. Thank you. Quote Link to comment Share on other sites More sharing options...
DonRomano Posted April 2, 2020 Share Posted April 2, 2020 Do you mean the Python sop node by saying "Houdini shelf tool" ? If yes, this node is more likely to operate on geo by using the python api made to process geometry (https://www.sidefx.com/docs/houdini/hom/hou/Geometry.html). The python panel is made to use python for both geometry manipulation and nodes manipulation (basically all python ops in Houdini) but the python sop can't, it evaluates on geometry only. If you want to create your own python to manipulate nodes, you can by following these steps : - drag down a null - add a string parameter named "code" and set it multiline/python - add a button labelled "Run" and set its callback to python (dropdown menu at the end of the line) and type : exec(kwargs["node"].parm("code").eval()) And you have your python code to execute code that manipulates nodes. I'm not sure if you can drag n drop a node path but you can do it in the python shell and then copy paste it into your python node. Cheers, Quote Link to comment Share on other sites More sharing options...
eunchae Posted April 3, 2020 Author Share Posted April 3, 2020 20 hours ago, DonRomano said: Do you mean the Python sop node by saying "Houdini shelf tool" ? If yes, this node is more likely to operate on geo by using the python api made to process geometry (https://www.sidefx.com/docs/houdini/hom/hou/Geometry.html). The python panel is made to use python for both geometry manipulation and nodes manipulation (basically all python ops in Houdini) but the python sop can't, it evaluates on geometry only. If you want to create your own python to manipulate nodes, you can by following these steps : - drag down a null - add a string parameter named "code" and set it multiline/python - add a button labelled "Run" and set its callback to python (dropdown menu at the end of the line) and type : exec(kwargs["node"].parm("code").eval()) And you have your python code to execute code that manipulates nodes. I'm not sure if you can drag n drop a node path but you can do it in the python shell and then copy paste it into your python node. Cheers, Thanks for your answer. But I don't think that's what I want. It is not the Python sop node. I want to use the drag and drop function That doesn't work. I want to do it like the one at the address below. But when I load that, it works only in the "python panel" If I copy and paste that into the shelf tool, it does not work. -> https://www.sidefx.com/docs/houdini/examples/python_panels/dragdrop.html (The shelf tool I'm talking about is at the top of Houdini.) Quote Link to comment Share on other sites More sharing options...
DonRomano Posted April 3, 2020 Share Posted April 3, 2020 I don't understand what you're trying to do. You want to create a shelf tool to drag and drop a node, but where ? And what's the purpose of doing that ? Have a look here it may help : https://www.sidefx.com/docs/houdini/hom/state_dragdrop.html Quote Link to comment Share on other sites More sharing options...
eunchae Posted April 3, 2020 Author Share Posted April 3, 2020 45 minutes ago, DonRomano said: I don't understand what you're trying to do. You want to create a shelf tool to drag and drop a node, but where ? And what's the purpose of doing that ? Have a look here it may help : https://www.sidefx.com/docs/houdini/hom/state_dragdrop.html Sorry for the lack of explanation. I want to drag the node to the UI I created. (Path will go in.. ex- /obj/phantom ) Thanks for the answer. Quote Link to comment Share on other sites More sharing options...
DonRomano Posted April 3, 2020 Share Posted April 3, 2020 I'm pretty sure it's not possible to do this for now, you have to create your ui into a python panel to be able to use the drag n drop feature. What you may do to solve this is to create a button where you can call the selected node and add it into your line parameter. You can get the current selected node path with : nodes = hou.selectedNodes() selected_node = nodes[0].path() Cheers, Quote Link to comment Share on other sites More sharing options...
eunchae Posted April 20, 2020 Author Share Posted April 20, 2020 On 2020. 4. 3. at 6:38 PM, DonRomano said: I'm pretty sure it's not possible to do this for now, you have to create your ui into a python panel to be able to use the drag n drop feature. What you may do to solve this is to create a button where you can call the selected node and add it into your line parameter. You can get the current selected node path with : nodes = hou.selectedNodes() selected_node = nodes[0].path() Cheers, 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.