Hey SideFX folks, is there a way to start the HARS server in Hython? Or maybe just a way to execute an initialization Python script when starting the HARS server.
We would like to spawn a HARS server with some in-house modifications on it which are all written in Python. Since there is a "Houdini Engine SessionSync" panel available in Houdini GUI, we assume that there must be an API to perform the same operation... but we cannot find it so far.
Any clues would be highly appreciated. Thanks.
Found 27 posts.
Search results Show results as topic list.
Houdini Engine API » How to start session sync by Python?
- calving
- 27 posts
- Offline
Solaris and Karma » How about supporting variants for SOP?
- calving
- 27 posts
- Offline
Streaming primitive from LOP to SOP creates a path attribute that figures out where the data came from. In contrast, LOP allows using this attribute to place the primitives, which is pretty helpful.
However, the path attribute only reaches the level of the primitives at the moment. But in USD, it also stores the information of the variant selections.
For instance, importing a SOP with the path of “/root/sub{variant=base}” would be better to create a Mesh to “/root/sub” with an auto-generated “variant” set and its “base” selection.
It would be extremely helpful for us because editing a specific variant by SOP is quite common in our pipeline. Or maybe Solaris has an alternative solution which I haven't found out yet?
However, the path attribute only reaches the level of the primitives at the moment. But in USD, it also stores the information of the variant selections.
For instance, importing a SOP with the path of “/root/sub{variant=base}” would be better to create a Mesh to “/root/sub” with an auto-generated “variant” set and its “base” selection.
It would be extremely helpful for us because editing a specific variant by SOP is quite common in our pipeline. Or maybe Solaris has an alternative solution which I haven't found out yet?
Solaris and Karma » How to import GeomSubSet to SOP?
- calving
- 27 posts
- Offline
Hey Cameron, sorry for the late reply. So far we are using 18.0.391, and that seems to be the reason. I'll update Houdini to 415 ASAP to see if it solves the problem.
Thanks for the kindly prompt!
Thanks for the kindly prompt!
Edited by calving - July 9, 2020 02:31:52
Solaris and Karma » How to import GeomSubSet to SOP?
- calving
- 27 posts
- Offline
Hey Solaris Team,
Export groups form SOP to LOP is fairly easy, but so far I cannot find the opposite way.
Imagine that I have a USD mesh with several subsets that I want to modify in the SOP context, and the source groups matter in my algorithm. What would be a decent way to transfer them? I noticed that the “shop_materialpath__*” is converted to a primitive attribute by default, but I didn't find the trick. Is it an obscure convention or a configurable rule? And if the latter, how it should be proceed?
Thanks,
Calvin Gu
Export groups form SOP to LOP is fairly easy, but so far I cannot find the opposite way.
Imagine that I have a USD mesh with several subsets that I want to modify in the SOP context, and the source groups matter in my algorithm. What would be a decent way to transfer them? I noticed that the “shop_materialpath__*” is converted to a primitive attribute by default, but I didn't find the trick. Is it an obscure convention or a configurable rule? And if the latter, how it should be proceed?
Thanks,
Calvin Gu
Solaris and Karma » What would be the proper way to set stage level metadata?
- calving
- 27 posts
- Offline
Solaris and Karma » What would be the proper way to set stage level metadata?
- calving
- 27 posts
- Offline
Hey Solaris folks,
I'm wondering is there a way to edit stage level metadata? The below snippet doesn't work and the node.stage() either.
Here is the exception message which is actually reasonable…
Since LOPs work with their own layers, the root operations are not supposed to work like this. However, the magic to do this is relatively important to us. Since the other hosts require these global variables to set up the scene.
I'm wondering is there a way to edit stage level metadata? The below snippet doesn't work and the node.stage() either.
node = hou.pwd() stage = node.editableStage() from pxr import UsdGeom UsdGeom.SetStageMetersPerUnit(stage, 1)
Here is the exception message which is actually reasonable…
'Cannot set layer metadata 'metersPerUnit' in current edit target "anon:0000000090963380", as it is not the root layer or session layer of stage "anon:000000009049C900:root.usd".'
Since LOPs work with their own layers, the root operations are not supposed to work like this. However, the magic to do this is relatively important to us. Since the other hosts require these global variables to set up the scene.
Solaris and Karma » Automatic transformation for upAxis and metersPerUnit?
- calving
- 27 posts
- Offline
jsmack
I would find it tremendously confusing if the displayed node affected the viewing characteristics in such a profound way. There are all kinds of ambiguities when it comes to combining nodes. I think LOPs is fundamentally incompatible with such a notion.
Umm… Fair enough, though, the fallback solution might be having Metrics LOP to do such a conversion? Since operations like changing UpAxis isn't as easy as rotating ninety degrees but swapping Y and Z along with switching orientation. The affected attributes / primvars could be controlled by the parameters… Or having all the above functionalities as a part of the File LOP would also be an intriguing idea…
Solaris and Karma » Automatic transformation for upAxis and metersPerUnit?
- calving
- 27 posts
- Offline
Hey Mark,
As I learned from usdview, the “metersPerUnit” does not affect the Hydra viewport. This metrics is just for validation purposes, as you mentioned. However, the “upAxis” does change the up axis of the Hydra viewport.
Instead of reading global preferences, it might be beneficial if Houdini GL does the same thing like Hydra here. I suspect the users are expecting to see the same result while they are visualizing a stage in both LOP and usdview. Then the actual transformation could be an optional argument of LOP Import as you say… which to unify the look of SOP and LOP…
As I learned from usdview, the “metersPerUnit” does not affect the Hydra viewport. This metrics is just for validation purposes, as you mentioned. However, the “upAxis” does change the up axis of the Hydra viewport.
Instead of reading global preferences, it might be beneficial if Houdini GL does the same thing like Hydra here. I suspect the users are expecting to see the same result while they are visualizing a stage in both LOP and usdview. Then the actual transformation could be an optional argument of LOP Import as you say… which to unify the look of SOP and LOP…
Edited by calving - Feb. 9, 2020 13:02:31
Solaris and Karma » Automatic transformation for upAxis and metersPerUnit?
- calving
- 27 posts
- Offline
Hey folks,
Since USD is encoding “upAxis” and “metersPerUnit” as the metadata on stage level. I'm wondering if Solaris could commit an automatic transformation while loading stages. It would be beneficial and avoiding to convert geometries to Houdini's baseline every time exporting them from other DCCs.
Cheers,
Calvin
Since USD is encoding “upAxis” and “metersPerUnit” as the metadata on stage level. I'm wondering if Solaris could commit an automatic transformation while loading stages. It would be beneficial and avoiding to convert geometries to Houdini's baseline every time exporting them from other DCCs.
Cheers,
Calvin
Solaris and Karma » Difference between Inline USD and SdfLayer ImportFromString?
- calving
- 27 posts
- Offline
Solaris and Karma » Difference between Inline USD and SdfLayer ImportFromString?
- calving
- 27 posts
- Offline
Hey Mark,
It has been a long time since the last time we got in touch. I'm working on building the bridge between Houdini and UE these days, and we found Solaris would be a great help for transferring data from one to the other.
To synchronize data rapidly, we're trying to set up a live stream instead of dumping everything to disk. In other words, we expect to import a stage with some python calls like this:
Unfortunately, the above snippet is not effective, at least in my tests. There's a workaround for this is to procedurally editing an Inline USD node. However, I'm interested in the magic of the implementation of the Inline USD node, as the flattened stage of this is the same as the python one…
Cheers,
Calvin
It has been a long time since the last time we got in touch. I'm working on building the bridge between Houdini and UE these days, and we found Solaris would be a great help for transferring data from one to the other.
To synchronize data rapidly, we're trying to set up a live stream instead of dumping everything to disk. In other words, we expect to import a stage with some python calls like this:
node = hou.pwd() stage = node.editableStage() stage.GetRootLayer().ImportFromString( """#usda 1.0 def \"sandbox\" { def Mesh \"box\" { int[] faceVertexCounts = [4, 4, 4, 4, 4, 4] int[] faceVertexIndices = [1, 5, 4, 0, 2, 6, 5, 1, 3, 7, 6, 2, 0, 4, 7, 3, 2, 1, 0, 3, 5, 6, 7, 4] point3f[] points = [(-0.5, -0.5, -0.5), (0.5, -0.5, -0.5), (0.5, -0.5, 0.5), (-0.5, -0.5, 0.5), (-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, 0.5)] } }""")
Unfortunately, the above snippet is not effective, at least in my tests. There's a workaround for this is to procedurally editing an Inline USD node. However, I'm interested in the magic of the implementation of the Inline USD node, as the flattened stage of this is the same as the python one…
Cheers,
Calvin
Edited by calving - Feb. 3, 2020 17:06:33
PDG/TOPs » Call for HDK of TOPs.
- calving
- 27 posts
- Offline
Hey PDG team,
Are there any plans to publish the C++ API of TOPs? It must be the most appealing feature for me if it comes with H18.
Are there any plans to publish the C++ API of TOPs? It must be the most appealing feature for me if it comes with H18.
Technical Discussion » What's the use of the custom folder in the lastest Houdini file structure?
- calving
- 27 posts
- Offline
Within the latest build of Houdini, there's always a folder named “custom” which contains a sub-folder of some dynamic libraries.
All of those libraries have a variant in the “bin” folder which is being used for Houdini. Therefore what would be the intention to list those libraries separately? Are there any potential usabilities of them?
Thanks
All of those libraries have a variant in the “bin” folder which is being used for Houdini. Therefore what would be the intention to list those libraries separately? Are there any potential usabilities of them?
Thanks
Technical Discussion » What about adding `QTableCornerButton::section` into base style sheet?
- calving
- 27 posts
- Offline
The issue is lasting for a long time. Which causes a weird white block on the top-left of QTable(View|Widget).
Personally, it could be exactly the same as the style of QHeaderView or any look that sync to the theme.
Personally, it could be exactly the same as the style of QHeaderView or any look that sync to the theme.
Technical Discussion » What's the $HOUDINI_USER_PREF_DIR/stats used for ?
- calving
- 27 posts
- Offline
edward
That directory collects anonymous user statistics. It's fine to just delete it. If you want to avoid generating them altogether, you can disable it from within Houdini or set environment variable HOUDINI_ANONYMOUS_STATISTICS to 0.
Thanks a lot, it makes sense.
Edited by calving - May 2, 2017 09:38:53
Technical Discussion » Can't find PY_Py_Finalize in PY/PY_CPythonAPI.h
- calving
- 27 posts
- Offline
rvinluan
Hmmm. Maybe you need to create the interpreter auto lock in each of those functions?
Cheers,
Rob
No, there's only one function contains CPythonAPI, but there are lots of methods (over ten) from FS_InfoHelper & FS_ReadHelper need to call this function at same time. So finally I make a static local variable in that function then use it to avoid repeatedly python call.
So everything work well now, thanks for your help !
Technical Discussion » What's the $HOUDINI_USER_PREF_DIR/stats used for ?
- calving
- 27 posts
- Offline
I found that Houdini automatically generate some JSON files in this folder during runtime. But I don't know what's the meaning of these files.
And because of some unknown reasons, I found about over one hundred thousands of JSON files in some artists' user folder (over 150MB), and these files cause us render farm occupied by Mantra for a long time after the image is generated.
Have anybody ran into this condition before? Why there are so many JSON files and will it cause anything wrong if I simply clean this folder each time Houdini startup?
And because of some unknown reasons, I found about over one hundred thousands of JSON files in some artists' user folder (over 150MB), and these files cause us render farm occupied by Mantra for a long time after the image is generated.
Have anybody ran into this condition before? Why there are so many JSON files and will it cause anything wrong if I simply clean this folder each time Houdini startup?
Edited by calving - April 28, 2017 04:48:11
Technical Discussion » Can't find PY_Py_Finalize in PY/PY_CPythonAPI.h
- calving
- 27 posts
- Offline
rvinluan
Oh, one other thing I forgot to mention is that `sys.path` may not be configured yet with Houdini paths whenpyExecution
runs. When I was testing, I had to set the PYTHONPATH environment variable to point to the folder containingmyHelper.py
before launching Houdini.
Without setting PYTHONPATH I found that myHelper.py could not be found and imported sopyExecution
would crash still.
It works! There are only two questions which aren't really serious.
First, it looks like HDK doesn't need PY_Py_DECREF to release the memory of PY_PyObject, this function will crash Houdini.
And second, when I try to let createStream & splitIndexFileSectionPath & combineIndexFileSectionPath call Python at same time, Houdini will crash when it starts (but Hython & Hbatch are well). I'm not sure whether my code leads to this or not.
Thanks a lot, I'll keep work on this and share new findings here.
Technical Discussion » Can't find PY_Py_Finalize in PY/PY_CPythonAPI.h
- calving
- 27 posts
- Offline
rvinluan
The pseudo-code looks ok to me.
Would you be able to send me your source code? I can give it a try here and see if I can reproduce the crash.
Thanks so much. The attachment is my source code.
The whole version is in our company's computer, I simply rewrite this to reproduce the crash. But interestingly, I found it will crash Houdini/Hython/Hbatch in Linux but only crash Houdini in Windows.
Edited by calving - April 20, 2017 12:34:50
Technical Discussion » Can't find PY_Py_Finalize in PY/PY_CPythonAPI.h
- calving
- 27 posts
- Offline
rvinluan
That's correct. You do not need to call Py_Initialize since Houdini does the Python initialization for you on startup.
Check out$HFS/toolkit/samples/HOM/ObjNode_setSelectable.C
. There's an example of using PY_InterpreterAutoLock in the HOMextendLibrary() function. The idea is to create a PY_InterpreterAutoLock object right before you intend to make Python calls. Typically you create the object on the stack so that it is created when execution enters the code block's scope and is destroyed when execution exits the scope.
Cheers,
Rob
Hi, Rob. I have followed the way to use PY_InterpreterAutoLock from ObjNode_setSelectable, but it looks can't work well in my context.
I try to call external python module in my custom FS_ReaderHelper, the pseudo-codes are like this:
pyHelper(UT_String source, UT_String &target)
{
PY_InterpreterAutoLock interpreter_auto_lock;
…make Python API calls…
}
MY_Helper::createStream(const char *source, const UT_Options *)
{
…call pyHelper to convert source…
}
void installFSHelpers()
{
new MY_Helper();
}
Then Houdini will crash during starting with a segmentation fault from PY_PYModule_GetDict in my pyHelper function, the traceback information figure out things happen in libpthread. Obviously about GIL.
This is confusing me. Any suggestions would be helpful!
Edited by calving - April 19, 2017 05:54:15
-
- Quick Links