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?
Found 10 posts.
Search results Show results as topic list.
Technical Discussion » How to dynamically create a radial menu in viewer state
- evianaive
- 10 posts
- Offline
Technical Discussion » Link up multparm from HDA-level to inside level w/o python?
- evianaive
- 10 posts
- Offline
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
Houdini Engine API » Hapi Failed when SetAttributeFloatArrayData with empty array
- evianaive
- 10 posts
- Offline
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?
Technical Discussion » Houdini not scanning HOUDINI_PACKAGE_DIR?
- evianaive
- 10 posts
- Offline
mabelzileThe problem is I don't want to edit houdini.env and add packages in user/document/houdini18.5/packages/ because I have several version of libs. Each one corresponding to different Unreal project. For example, Project A use 1.0 version and Project B use 1.1 version.
HOUDINI_PACKAGE_PATH is set by HOUDINI automatically with the current package folder path being scanned allowing you to set env vars relative to a package location. You don't need to set it by yourself.
Your package seems fine, are you getting any errors when your lib is loaded ?
The package file I want to load is UnrealPojectDir/Plugins/hdalib/Content/hdalib/packages/hda_module.json.
As a result, I have to generate a houdini.env file for each unreal project to load this package because houdini engine session only supported loading .env file when I initial session.
Technical Discussion » Houdini not scanning HOUDINI_PACKAGE_DIR?
- evianaive
- 10 posts
- Offline
mabelzileI create a hda&vex lib as a content only plugin for UE4. I was planning to use a generate a houdini.env file before HAPI_Initialize() and use this houdini.env file as parameter of HAPI_Initialize(). I thought I can set HOUDINI_PACKAGE_DIR in houdini.env. The package file will append HOUDINI_OTLSCAN_PATH, HOUDINI_VEX_PATH, HOUDINI_OCL_PATH.
houdini.env is processed after the packages. You need to set these variables in your environment (e.g. shell terminal) before starting Houdini.
As you have mentioned, however, it seems I can't do this because houdini.env is processed after the packages. So what should I do?
HAPI_Initialize( const HAPI_Session * session,
const HAPI_CookOptions * cook_options,
HAPI_Bool use_cooking_thread,
int cooking_thread_stack_size,
const char * houdini_environment_files,
const char * otl_search_path,
const char * dso_search_path,
const char * image_dso_search_path,
const char * audio_dso_search_path );
My package json file
{
"path": [
{
"value" : "$HOUDINI_PACKAGE_PATH/hda_module",
"method" : "append"
}
],
"env": [
{
"hdalib": "$HOUDINI_PACKAGE_PATH/hda_module"
},
{
"HOUDINI_OTLSCAN_PATH": {
"method": "append",
"value": [
"$hdalib/otls/Czx",
"$hdalib/otls/Lz",
"$hdalib/otls/Lyc",
"$hdalib/otls/Pb"
]
}
},
{
"PYTHONPATH": "$hdalib/python"
},
{
"HOUDINI_OCL_PATH": {
"method": "append",
"value": [
"$hdalib/ocl"
]
}
},
{
"HOUDINI_TOOLBAR_PATH":{
"method": "append",
"value": [
"$hdalib/toolbar"
]
}
}
]
}
Houdini Engine for Unreal » Problem with using relative path in HDA parameter in ue4
- evianaive
- 10 posts
- Offline
I thought the source code of updating relative path part start from line 3760 in "HoudiniEngine/Source/HoudiniEngineEditor/HoudiniParameterDetails.cpp"
auto UpdateCheckRelativePath = (const FString & PickedPath)
{
UHoudiniAssetComponent* HoudiniAssetComponent = Cast<UHoudiniAssetComponent>(MainParam->GetOuter());
if (MainParam->GetOuter() && !PickedPath.IsEmpty() && FPaths::IsRelative(PickedPath))
{
// Check if the path is relative to the UE4 project
FString AbsolutePath = FPaths::ConvertRelativePathToFull(PickedPath);
if (FPaths::FileExists(AbsolutePath))
{
return AbsolutePath;
}
// Check if the path is relative to the asset
if (HoudiniAssetComponent && !HoudiniAssetComponent->IsPendingKill())
{
if (HoudiniAssetComponent->HoudiniAsset && !HoudiniAssetComponent->HoudiniAsset->IsPendingKill())
{
FString AssetFilePath = FPaths::GetPath(HoudiniAssetComponent->HoudiniAsset->AssetFileName);
if (FPaths::FileExists(AssetFilePath))
{
FString UpdatedFileWidgetPath = FPaths::Combine(*AssetFilePath, *PickedPath);
if (FPaths::FileExists(UpdatedFileWidgetPath))
{
return UpdatedFileWidgetPath;
}
}
}
}
}
return PickedPath;
};
auto UpdateCheckRelativePath = (const FString & PickedPath)
{
UHoudiniAssetComponent* HoudiniAssetComponent = Cast<UHoudiniAssetComponent>(MainParam->GetOuter());
if (MainParam->GetOuter() && !PickedPath.IsEmpty() && FPaths::IsRelative(PickedPath))
{
// Check if the path is relative to the UE4 project
FString AbsolutePath = FPaths::ConvertRelativePathToFull(PickedPath);
if (FPaths::FileExists(AbsolutePath))
{
return AbsolutePath;
}
// Check if the path is relative to the asset
if (HoudiniAssetComponent && !HoudiniAssetComponent->IsPendingKill())
{
if (HoudiniAssetComponent->HoudiniAsset && !HoudiniAssetComponent->HoudiniAsset->IsPendingKill())
{
FString AssetFilePath = FPaths::GetPath(HoudiniAssetComponent->HoudiniAsset->AssetFileName);
if (FPaths::FileExists(AssetFilePath))
{
FString UpdatedFileWidgetPath = FPaths::Combine(*AssetFilePath, *PickedPath);
if (FPaths::FileExists(UpdatedFileWidgetPath))
{
return UpdatedFileWidgetPath;
}
}
}
}
}
return PickedPath;
};
Houdini Engine for Unreal » Problem with using relative path in HDA parameter in ue4
- evianaive
- 10 posts
- Offline
https://www.sidefx.com/docs/unreal/_parameters.html#ParametersFile [www.sidefx.com]
The document explain paths relative to unreal project are converted to absolute paths in Houdini. But in my test, it turns out that it's relative to UE4Editor.exe but not current unreal project.
For example I have a test.bgeo in my ue project directory which is "D:/HoudiniFiles/UeProjects/Project7/". What I expected is I can just type "test.bgeo" in file parameter of houdini_bgeo_import(a hda contained by houdini engine plugin) and It will be converted to "D:/HoudiniFiles/UeProjects/Project7/test.bgeo". However, what really happens is It was converted to "D:/unreal/UE_4.26/Engine/Binaries/Win64/test.bgeo", which is the directory of UE4Editor. Although it is exactly how unreal engine deal with relative path, this doesn't correspond to the documents.
People would place their project wherever they like and these path problems make transfering project terrible. In some topics, I see a methord which is manually declaring project path on HDA. Is there any way to solve this by editing source code of houdini engine?
The document explain paths relative to unreal project are converted to absolute paths in Houdini. But in my test, it turns out that it's relative to UE4Editor.exe but not current unreal project.
For example I have a test.bgeo in my ue project directory which is "D:/HoudiniFiles/UeProjects/Project7/". What I expected is I can just type "test.bgeo" in file parameter of houdini_bgeo_import(a hda contained by houdini engine plugin) and It will be converted to "D:/HoudiniFiles/UeProjects/Project7/test.bgeo". However, what really happens is It was converted to "D:/unreal/UE_4.26/Engine/Binaries/Win64/test.bgeo", which is the directory of UE4Editor. Although it is exactly how unreal engine deal with relative path, this doesn't correspond to the documents.
People would place their project wherever they like and these path problems make transfering project terrible. In some topics, I see a methord which is manually declaring project path on HDA. Is there any way to solve this by editing source code of houdini engine?
Houdini Engine for Unreal » PDG cooking is expecting files to be under UE install?
- evianaive
- 10 posts
- Offline
dpernuit
Hi,
So, my recommended workflow for PDG would be:
- Use $PDG_DIR for all paths, don't use $JOB and $HIP.
$JOB could be used if set in an env file, but setting it up properly is not as easy as PDG_DIR.
Using $HIP doesn't make sense when using Houdini Engine, since there is no HIP file.
- Expose the Working Directory parameter on the TOP Scheduler on your HDA, and set that working directory via the HDA parameters in Unreal. This ensures that both Unreal and Houdini understand that directory properly ($PDG_DIR).
- I then use that directory a my main PDG folder for the PDG Asset Link:
I place all the HDAs needed by PDG in a hda subfolder, and use "$PDG_DIR/hda/XXX" for my HDA processors.
Same thing for any input/output files, just use subfolders for them and reference them in the HDA with $PDG_DIR.
By doing that, you basically only need to worry about setting that Working Directory parameter, and having everything needed under that folder tends to make things a lot more portable.
https://www.sidefx.com/docs/unreal/_parameters.html#ParametersFile [www.sidefx.com]
The documents of houdini engine for unreal says "paths relative to the unreal project are converted to absolute paths in Houdini". I tried by setting my file parameter as things like 'Content/geo/test.bgeo', '/Content/geo/test.bgeo', 'Game/geo/test.bgeo' and so on. None of them works.
Has this feature finished? Or my relative path is not correct? Setting a directory for each hda costs time.
Houdini Indie and Apprentice » how to loop on vdbs(name is unkown) in volume wrangle
- evianaive
- 10 posts
- Offline
before i resample all the vdbs, i dit a lot of caculation in the vex. I caculate the rest position of voxel, and use the rest to sample the original vdb. Now i want to loop over all the vdbs the wrangle recieved, but i found that i can only edit the vdb by @volume_name?? what if i don't know it or i just want to use primtive index to get it?
int prim=0;
vector uvw={0,0,0};
float dist=xyzdist(1,@P,prim,uvw);
vector P = primuv(1,“P”,prim,uvw);
matrix3 m = primuv(1,“m”,prim,uvw);
vector up = set(m.xx,m.xy,m.xz);
vector N = set(m.yx,m.yy,m.yz);
vector rest={0,0,0};
rest=dot((P-@P),N)/length2(N);
rest=dot((@P-P),up)/length2(N);
restuvw-chf(“../pointwrangle2/offset”))/chf(“../pointwrangle2/stretch”)*prim(1,“curveLength”,0);
for(int i=0;i<6;i++){
@volume_name=volumesample(2,i,rest); //i hope this step i can use i to get the vdb
}
int prim=0;
vector uvw={0,0,0};
float dist=xyzdist(1,@P,prim,uvw);
vector P = primuv(1,“P”,prim,uvw);
matrix3 m = primuv(1,“m”,prim,uvw);
vector up = set(m.xx,m.xy,m.xz);
vector N = set(m.yx,m.yy,m.yz);
vector rest={0,0,0};
rest=dot((P-@P),N)/length2(N);
rest=dot((@P-P),up)/length2(N);
restuvw-chf(“../pointwrangle2/offset”))/chf(“../pointwrangle2/stretch”)*prim(1,“curveLength”,0);
for(int i=0;i<6;i++){
@volume_name=volumesample(2,i,rest); //i hope this step i can use i to get the vdb
}
3rd Party » Modeler 2020
- evianaive
- 10 posts
- Offline
I am wondering where is draw_shape node? Is it removed in this version? Is there any way to add it back by myself? I load it from old HDA. but it can't active interactively. it's properties are also not allowed to be edit.
-
- Quick Links