Found 39 posts.
Search results Show results as topic list.
Technical Discussion » HDA with primary input + secondary inputs
- aaronauty
- 39 posts
- Offline
This would be a very useful feature for LOPS development. Did you ever make an RFE for this?
Solaris and Karma » loputils - looking for the popup menu like selectPrimsInParm
- aaronauty
- 39 posts
- Offline
mtucker
If you're just talking about bringing up a popup window for choosing a prim, that's done with the husdui.dialogs.primpicker module (which is used by all these functions if the scene viewer can't be used for the selection).
Just what I was after, cheers.
Solaris and Karma » loputils - looking for the popup menu like selectPrimsInParm
- aaronauty
- 39 posts
- Offline
I am looking for something in loptoolutils/loputils to allow a selection of prims in a toolscript.
The selectPrimsInParm() menu is what I am looking for, but it requires a parmtuple in the kwargs dict.
Can I build this menu passing in a hou.LopNode, and get the return as a list of primpaths?
Cheers,
Aaron.
The selectPrimsInParm() menu is what I am looking for, but it requires a parmtuple in the kwargs dict.
Can I build this menu passing in a hou.LopNode, and get the return as a list of primpaths?
Cheers,
Aaron.
Technical Discussion » Solaris USD PointInstancer - lopimport rotation issue
- aaronauty
- 39 posts
- Offline
I am seeing a discrepancy in rotations when USD PointInstancers are converted to sops using the lopimport SOP. As the rotations approach the poles of a circle, I can see a small shift between lops/sops.
I believe I have tracked this back to the ComputeInstanceTransformsAtTime method of the PointInstancer, as I can re-create this using an inlinelop and a pythonlop.
Here I have some USD representing a smaller section of a circle, instancing a simple box. Pop this into the inlinelop.
Here is a snippet to go into a pythonlop iterating over the instances, and grabbing the matrix from the point, and applying it to the new prims Xform. If I compare their orients after this, I can see a small discrepancy near the pole.
you will see a small shift in the rotation, and the angle between the 2 quaternions is slightly off. If you use a lopimport sop in SOPS, you will also visually see the shift as I have colored the prims red. Is this something that will first need to be fixed on the USD side? Or is this something to do with the formatting of the orientations?
Cheers,
Aaron.
I believe I have tracked this back to the ComputeInstanceTransformsAtTime method of the PointInstancer, as I can re-create this using an inlinelop and a pythonlop.
Here I have some USD representing a smaller section of a circle, instancing a simple box. Pop this into the inlinelop.
#sdf 1.4.32 def PointInstancer "my_instancer" { int64[] invisibleIds = [] quath[] orientations = [(0.998535, 0, 0, -0.0565186), (0.999023, 0, 0, -0.0439758), (0.999512, 0, 0, -0.0314026), (1, 0, 0, -0.0188446), (1, 0, 0, -0.00628281), (1, 0, 0, 0.00628281), (1, 0, 0, 0.0188446), (0.999512, 0, 0, 0.0314026), (0.999023, 0, 0, 0.0439758), (0.998535, 0, 0, 0.0565186)] point3f[] positions = [(-8.911743, 0.5044851, 0), (-6.937198, 0.30531064, 0), (-4.9582753, 0.15582031, 0), (-2.9762185, 0.05610727, 0), (-0.99228066, 0.006234976, 0), (0.99228066, 0.006234976, 0), (2.976217, 0.056106895, 0), (4.958278, 0.15581957, 0), (6.9371996, 0.30531064, 0), (8.911743, 0.5044858, 0)] int[] protoIndices = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] rel prototypes = </my_instancer/Prototypes/Root> def Scope "Prototypes" { def Xform "Root" ( ) { def Cube "cube" ( ) { double size = 2 } } } }
Here is a snippet to go into a pythonlop iterating over the instances, and grabbing the matrix from the point, and applying it to the new prims Xform. If I compare their orients after this, I can see a small discrepancy near the pole.
node = hou.pwd() stage = node.editableStage() import pxr prim = stage.GetPrimAtPath("/my_instancer") instancer = pxr.UsdGeom.PointInstancer(prim) orients = instancer.GetOrientationsAttr().Get() xforms = instancer.ComputeInstanceTransformsAtTime(pxr.Usd.TimeCode.Default(), pxr.Usd.TimeCode.Default()) for index, xform in enumerate(xforms): xform_prim = pxr.UsdGeom.Xform.Define(stage, '/cube_grp{}'.format(index)) cube_prim = pxr.UsdGeom.Cube.Define(stage, '/cube_grp{}/cube'.format(index)) cube_prim.GetDisplayColorAttr().Set([(1, 0, 0)]) xform_prim.AddTransformOp(opSuffix="from_instancer").Set(xform) prim_orient = xform_prim.GetLocalTransformation().ExtractRotation().GetQuat() prim_quat_h = pxr.Gf.Quath(prim_orient) # I have converted the Quatd to a Quath to match the types print "xform prim orient:" print prim_quat_h print "instancer point orient:" print orients[index] match = prim_quat_h == orients[index] # This will error assert match == True
you will see a small shift in the rotation, and the angle between the 2 quaternions is slightly off. If you use a lopimport sop in SOPS, you will also visually see the shift as I have colored the prims red. Is this something that will first need to be fixed on the USD side? Or is this something to do with the formatting of the orientations?
Cheers,
Aaron.
Technical Discussion » Solaris - Force cook stage and export - stage is null
- aaronauty
- 39 posts
- Offline
def getstage(lop): hou.setUpdateMode(hou.updateMode.AutoUpdate) stage = lop.stage() hou.setUpdateMode(hou.updateMode.Manual) return stage
Of course. Such a simple solution…. I didn't think it was a lops issue, I guess I have always relied on already compiled node for export, and they must be running similar code.
Brilliants cheers.
Technical Discussion » Solaris - Force cook stage and export - stage is null
- aaronauty
- 39 posts
- Offline
Hey Mark.
I missed a crucial piece of information above! My query was when the Houdini session is in Manual mode.
I am checking the hou.updateModeSetting() for manual and then forcing the cook.
Auto and OnMouse are cooking and exporting as expected.
Would you expect a Houdini session in Manual mode to cook a lop node with lopNode.stage() in manual mode? Could it still be errors further up the network?
Aaron.
I missed a crucial piece of information above! My query was when the Houdini session is in Manual mode.
I am checking the hou.updateModeSetting() for manual and then forcing the cook.
Auto and OnMouse are cooking and exporting as expected.
Would you expect a Houdini session in Manual mode to cook a lop node with lopNode.stage() in manual mode? Could it still be errors further up the network?
Aaron.
Edited by aaronauty - Dec. 4, 2020 19:38:50
Technical Discussion » Solaris - Force cook stage and export - stage is null
- aaronauty
- 39 posts
- Offline
Is it possible to force a cook of the Solaris stage before using a custom ROP to export the USD using HOM?
I have custom code querying the incoming stage to populate parameters as a pre-flight to the export.
I have tried calling lopnode.cook(force=True), but the stage is null when I query it after forcing the cook.
The Solaris USD Rop node seems to force the cook. Is this not a possible using LOPS and HOM? Do I have any options?
Cheers,
Aaron.
I have custom code querying the incoming stage to populate parameters as a pre-flight to the export.
I have tried calling lopnode.cook(force=True), but the stage is null when I query it after forcing the cook.
The Solaris USD Rop node seems to force the cook. Is this not a possible using LOPS and HOM? Do I have any options?
Cheers,
Aaron.
Solaris and Karma » LOPS - Inline CPP
- aaronauty
- 39 posts
- Offline
Is it on the roadmap to support inline CPP inside of Solaris?
I am using HOM extensively, and would love to have access to C++ in Solaris without building plugins, due to complex build dependencies.
Cheers,
Aaron.
I am using HOM extensively, and would love to have access to C++ in Solaris without building plugins, due to complex build dependencies.
Cheers,
Aaron.
Solaris and Karma » pxr.Gf.Ray intersection with bounding box.
- aaronauty
- 39 posts
- Offline
I was able to solve this using sop verbs to build the hou.Geometry() object from the UsdGeomBBoxCache's , and use the stateutils.sopGeometryIntersection method.
Solaris and Karma » pxr.Gf.Ray intersection with bounding box.
- aaronauty
- 39 posts
- Offline
I am writing a python state in a lop node that needs to raycast into the scene viewer.
I can't find anything in stateutils to assist with this, so I am rolling my own, and am having issues getting GfRay to work as expected.
The intersection seems to return true no matter where I position my start/end vectors.
hip file attached to demonstrate what I am trying to achieve outside of the state.
Cheers,
Aaron.
I can't find anything in stateutils to assist with this, so I am rolling my own, and am having issues getting GfRay to work as expected.
- I have constructed a GfRay passing in two vectors for start/end.
- I have constructed UsdGeomBBoxCache's for the prims on the stage.
- I am calling the GfRay's Intersect method, and passing in a GfRange3d, as the signature does not support a UsdGeomBBoxCache. I am calling ComputeAlignedBox on the UsdGeomBBoxCache's to get the GfRange3d.
The intersection seems to return true no matter where I position my start/end vectors.
hip file attached to demonstrate what I am trying to achieve outside of the state.
Cheers,
Aaron.
Edited by aaronauty - Oct. 23, 2020 08:51:39
Technical Discussion » Solaris - population masks and further editing
- aaronauty
- 39 posts
- Offline
mtucker
that population mask set in the python LOP has now “infected” every other LOP node
Yes, this was the behaviour I was seeing, the population mask was persisting to any nodes stage!
mtucker
Visiblity and activation control are generally more forgiving
I will use activation.
Cheers.
Technical Discussion » Solaris - population masks and further editing
- aaronauty
- 39 posts
- Offline
I am having issues using pxr.Usd.StagePopulationMask() in HOM, or the same functionality using the configurestage LOP.
After using a population mask using either of the above two methods I am seeing errors applying further edits to the stage.
Is the stage no longer editable once a population mask has been applied?
Hip file attached;
After using a population mask using either of the above two methods I am seeing errors applying further edits to the stage.
Is the stage no longer editable once a population mask has been applied?
Hip file attached;
Technical Discussion » VEX Builder - VOPS, get evaluated parameter input value.
- aaronauty
- 39 posts
- Offline
Hey there.
A channel reference only gives me greyed out value of the parameter on the object in question, as it has wire coming in.
I am looking to get the value of input the wire.
Some context. I am hoping to use this value to drive attributes on a UsdShade preview material, so I will be hopefully be writing the value to a hidden parameter that I can later evaluate.
A channel reference only gives me greyed out value of the parameter on the object in question, as it has wire coming in.
I am looking to get the value of input the wire.
Some context. I am hoping to use this value to drive attributes on a UsdShade preview material, so I will be hopefully be writing the value to a hidden parameter that I can later evaluate.
Technical Discussion » VEX Builder - VOPS, get evaluated parameter input value.
- aaronauty
- 39 posts
- Offline
I am looking for a method to get the evaluated value of a VOP parameter input inside of a mat context.
Querying the parm using HOM is not correct, as the shader has not been evaluated, and honestly, the value is not bound to anything. I am just using VOP's to wire together primitive values, vectors and floats.
Would I first need to gather the shader code by calling;
And then parse the result? Or have I missed something awfully simple?!
Similar to what the functionality of the print vop;
https://www.sidefx.com/docs/houdini/nodes/vop/print.html [www.sidefx.com]
Querying the parm using HOM is not correct, as the shader has not been evaluated, and honestly, the value is not bound to anything. I am just using VOP's to wire together primitive values, vectors and floats.
Would I first need to gather the shader code by calling;
my_shader_vop.shaderCode()
Similar to what the functionality of the print vop;
https://www.sidefx.com/docs/houdini/nodes/vop/print.html [www.sidefx.com]
Technical Discussion » SOLARIS - UsdPreviewSurface texture scale
- aaronauty
- 39 posts
- Offline
Low quality Karma sounds like the right solution for material visualisation, cheers, I'll look into it.
Technical Discussion » SOLARIS - UsdPreviewSurface texture scale
- aaronauty
- 39 posts
- Offline
Hey Rafal. Very clear, understood.
As the work I am currently doing in SOLARIS is scene assembly, not final pixels, I am looking at options for preview shaders only.
The Houdini GL delegate, is it limited to what USDShade currently provides? Without creating custom Schemas, is it currently possible to write missing functionality using inline code?
I noticed when I import a VOPNET from /mat, the VEX code for the shader lives under the attribute uniform string info:sourceCode. There is no way for the delegate to interpret this right?
As the work I am currently doing in SOLARIS is scene assembly, not final pixels, I am looking at options for preview shaders only.
The Houdini GL delegate, is it limited to what USDShade currently provides? Without creating custom Schemas, is it currently possible to write missing functionality using inline code?
I noticed when I import a VOPNET from /mat, the VEX code for the shader lives under the attribute uniform string info:sourceCode. There is no way for the delegate to interpret this right?
Technical Discussion » SOLARIS - UsdPreviewSurface texture scale
- aaronauty
- 39 posts
- Offline
Looking at the version of the bundled USD included with Houdini, it looks like we are using 19.11.
I have seen mixed reports of this shader not working before 20.08, so that could be the issue.
I have seen mixed reports of this shader not working before 20.08, so that could be the issue.
Technical Discussion » SOLARIS - UsdPreviewSurface texture scale
- aaronauty
- 39 posts
- Offline
I am trying to scale textures in SOLARIS using the UsdPreviewSurface.
I have models/uv's/texture/st working fine. As soon as I wire in a UsdTransform2d the texture read stops displaying.
Try this example from here https://graphics.pixar.com/usd/docs/Simple-Shading-in-USD.html [graphics.pixar.com] in a python_lop.
I'm not 100% sure the wiring is correct;
I have models/uv's/texture/st working fine. As soon as I wire in a UsdTransform2d the texture read stops displaying.
Try this example from here https://graphics.pixar.com/usd/docs/Simple-Shading-in-USD.html [graphics.pixar.com] in a python_lop.
I'm not 100% sure the wiring is correct;
node = hou.pwd() stage = node.editableStage() from pxr import Gf, Kind, Sdf, Usd, UsdGeom, UsdShade modelRoot = UsdGeom.Xform.Define(stage, "/TexModel") Usd.ModelAPI(modelRoot).SetKind(Kind.Tokens.component) billboard = UsdGeom.Mesh.Define(stage, "/TexModel/card") billboard.CreatePointsAttr([(-430, -145, 0), (430, -145, 0), (430, 145, 0), (-430, 145, 0)]) billboard.CreateFaceVertexCountsAttr([4]) billboard.CreateFaceVertexIndicesAttr([0,1,2,3]) billboard.CreateExtentAttr([(-430, -145, 0), (430, 145, 0)]) texCoords = billboard.CreatePrimvar("st", Sdf.ValueTypeNames.TexCoord2fArray, UsdGeom.Tokens.varying) texCoords.Set([(0, 0), (1, 0), (1,1), (0, 1)]) material = UsdShade.Material.Define(stage, '/TexModel/boardMat') pbrShader = UsdShade.Shader.Define(stage, '/TexModel/boardMat/PBRShader') pbrShader.CreateIdAttr("UsdPreviewSurface") pbrShader.CreateInput("roughness", Sdf.ValueTypeNames.Float).Set(0.4) pbrShader.CreateInput("metallic", Sdf.ValueTypeNames.Float).Set(0.0) material.CreateSurfaceOutput().ConnectToSource(pbrShader, "surface") stReader = UsdShade.Shader.Define(stage, '/TexModel/boardMat/stReader') stReader.CreateIdAttr('UsdPrimvarReader_float2') stInput = material.CreateInput('frame:stPrimvarName', Sdf.ValueTypeNames.Token) stInput.Set('st') stReader.CreateInput('varname',Sdf.ValueTypeNames.Token).ConnectToSource(stInput) #Texture2d node, bypassing this in the diffuseTextureSampler will work transform_2d = UsdShade.Shader.Define(stage, '/TexModel/boardMat/transform_2d') transform_2d.CreateIdAttr('UsdTransform2d') transform_2d.CreateInput("in", Sdf.ValueTypeNames.Float2).ConnectToSource(stReader, 'result') transform_2d.CreateInput("scale", Sdf.ValueTypeNames.Float2).Set((0.5, 0.5)) diffuseTextureSampler = UsdShade.Shader.Define(stage,'/TexModel/boardMat/diffuseTexture') diffuseTextureSampler.CreateIdAttr('UsdUVTexture') diffuseTextureSampler.CreateInput('file', Sdf.ValueTypeNames.Asset).Set("$HFS/houdini/pic/texture/bricks001_basecolor.rat") diffuseTextureSampler.CreateInput("st", Sdf.ValueTypeNames.Float2).ConnectToSource(transform_2d, 'result') pbrShader.CreateInput("diffuseColor", Sdf.ValueTypeNames.Color3f).ConnectToSource(diffuseTextureSampler, 'rgb') UsdShade.MaterialBindingAPI(billboard).Bind(material)
Technical Discussion » Importing Python Modules
- aaronauty
- 39 posts
- Offline
You can use hou.session to create python accessible anywhere in the current session. It's good for global functionality.
https://www.sidefx.com/docs/houdini/hom/hou/session.html [www.sidefx.com]
You can write to the session module like this;
hou.appendSessionModuleSource(my_module)
https://www.sidefx.com/docs/houdini/hom/hou/session.html [www.sidefx.com]
You can write to the session module like this;
hou.appendSessionModuleSource(my_module)
Technical Discussion » PyQT showInParametersPane - Draw default parameters.
- aaronauty
- 39 posts
- Offline
I am implementing custom PyQT widgets for otls using the amazing showInParametersPane hint.
This is working great, however I am needing to write a lot of boilerplate code to implement PyQT versions of parameters.
I am currently doing this by creating custom widgets and iterating over the ParmTemplates of the node. Not trivial.
Would it be possible to use pre-existing Houdini styled PyQT widgets using HOM? Or would this need to be done with HDK?
Cheers,
Aaron.
This is working great, however I am needing to write a lot of boilerplate code to implement PyQT versions of parameters.
I am currently doing this by creating custom widgets and iterating over the ParmTemplates of the node. Not trivial.
Would it be possible to use pre-existing Houdini styled PyQT widgets using HOM? Or would this need to be done with HDK?
Cheers,
Aaron.
-
- Quick Links