雨聪 李

evianaive

About Me

Connect

LOCATION
Not Specified
ウェブサイト

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Hapi Failed when SetAttributeFloatArrayData with empty array 2023年8月3日8:02

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?

Houdini not scanning HOUDINI_PACKAGE_DIR? 2021年10月12日23:42

mabelzile
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 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.
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.

Houdini not scanning HOUDINI_PACKAGE_DIR? 2021年10月12日4:08

mabelzile
houdini.env is processed after the packages. You need to set these variables in your environment (e.g. shell terminal) before starting Houdini.
I 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.
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"
]
}
}
]
}