雨聪 李
evianaive
About Me
Connect
LOCATION
Not Specified
WEBSITE
Houdini Skills
Availability
Not Specified
Recent Forum Posts
How to dynamically create a radial menu in viewer state April 20, 2024, 4:07 a.m.
I know self.scene_viewer.displayRadialMenu('name of an registered radial menu') can show menu on the screen
What I want is dynamically bind action callback for the items in an exist radial menu or make an temp radial menu.
I have noticed that I can get radial menu by rm = hou.ui.radialMenu('menu name'). Then get item on top by top_it=rm.root().item(hou.radialItemLocation.Top). But it looks like that top_it.setActionCallback(func) don't work. In the document it says setActionCallback only works on temporary items created via hou.ui.createRadialItem, which mean I have to create temporary radial menu.
The document also mentioned about hou.ui.injectRadialItem and hou.ui.injectRadialMenu. I may need to create a temporary radial menu by these methods. However I tried those methods and nothing happens. I guess maybe they have been deprecated now.
Is there anyone knows how to use these methods?
What I want is dynamically bind action callback for the items in an exist radial menu or make an temp radial menu.
I have noticed that I can get radial menu by rm = hou.ui.radialMenu('menu name'). Then get item on top by top_it=rm.root().item(hou.radialItemLocation.Top). But it looks like that top_it.setActionCallback(func) don't work. In the document it says setActionCallback only works on temporary items created via hou.ui.createRadialItem, which mean I have to create temporary radial menu.
The document also mentioned about hou.ui.injectRadialItem and hou.ui.injectRadialMenu. I may need to create a temporary radial menu by these methods. However I tried those methods and nothing happens. I guess maybe they have been deprecated now.
Is there anyone knows how to use these methods?
Link up multparm from HDA-level to inside level w/o python? Dec. 19, 2023, 2:33 a.m.
tamteI tried this method. However, it just link parameter by index. For example, I have four points in an add node, and I link ..//enable# to usept# parameter of add node. When I remove one instance of point for example I remove point2, the process of two node is different. For add node, the instance 2 in the list parameter is removed. For the other node, it remove the last instance.
if those multiparm structures match It's much easier to just delete your Multiparm on HDA in Type properties and then promote the one from your wrangle (Drag&Drop or from From Nodes section)
that will automatially create link
if you want to do it manually you can use opmultiparm command in the Textport or call it from Python
https://www.sidefx.com/docs/houdini/commands/opmultiparm.html [www.sidefx.com]
once the link is established all multiparm instances will be automatically linked so no need to call anything when number of instances changes
param list of add node
usept0 true pos0 0,0,0
usept1 false pos1 1,1,1
usept2 true pos2 2,2,2
usept3 true pos3 3,3,3
param list of another node
enable0 true attached_param1 5 ...
enable1 false attached_param1 6 ...
enable2 true attached_param1 7 ...
enable3 true attached_param1 8 ...
after I remove the second instance of list:
param list of add node
usept0 true pos0 0,0,0
usept1 true pos1 2,2,2
usept2 true pos2 3,3,3
param list of another node
enable0 true attached_param1 5 ...
enable1 true attached_param1 6(this is supposed to be 7) ...
enable2 true attached_param1 7(this is supposed to be 8) ...
I want to sync the remove action. However I can't get the element I remove in the callback
Hapi Failed when SetAttributeFloatArrayData with empty array Aug. 3, 2023, 8:02 a.m.
In geometry sheet it should looks like for each element if it works.
the api is
FHoudiniApi::SetAttributeFloatArrayData(
NodeId,
ParentId,
TCHAR_TO_ANSI(*AttribName),
&AttribInfo,
Array.GetData(),
Array.Num(),
SizeFixedArray.GetData(),
0,
SizesFixedArray.Num());
for example I have two points, and I want to create an empty float array attribute for them. I just set AttribInfo.count to 2, tuple size to 1. totalArrayElements to 0. SizeFixedArray to {0,0}. Array is Empty. Is it rigth? Or should I set SizeFixedArray empty? Or just create the attribute but do not set? Or it is not valid to create an empty array attrib?
the api is
FHoudiniApi::SetAttributeFloatArrayData(
NodeId,
ParentId,
TCHAR_TO_ANSI(*AttribName),
&AttribInfo,
Array.GetData(),
Array.Num(),
SizeFixedArray.GetData(),
0,
SizesFixedArray.Num());
for example I have two points, and I want to create an empty float array attribute for them. I just set AttribInfo.count to 2, tuple size to 1. totalArrayElements to 0. SizeFixedArray to {0,0}. Array is Empty. Is it rigth? Or should I set SizeFixedArray empty? Or just create the attribute but do not set? Or it is not valid to create an empty array attrib?