What is Houdini's equivalent to Maya's objExists()
2999 3 1- AlchemistRS
- Member
- 10 posts
- Joined: Jan. 2015
- Offline
- symek
- Member
- 1390 posts
- Joined: July 2005
- Offline
Since Houdini scene has a structure of (nested) directories you have to rely on recursive search to find object in any of subdirectories (subnets in Houdini lingua) similarly to searching files on disk.
So instead of usual:
hou.node(“/obj”).glob(“box*”) –> for multi /obj/box1 /obj/box2
you would rather use:
hou.node(“/”).recursiveGlob(“box*”, filter=hou.nodeTypeFilter.NoFilter) –> /obj/box1 /obj/geo/box1 /shop/box_material etc
More help:
http://www.sidefx.com/docs/houdini15.0/hom/hou/Node [sidefx.com]
hope this helps,
skk.
So instead of usual:
hou.node(“/obj”).glob(“box*”) –> for multi /obj/box1 /obj/box2
you would rather use:
hou.node(“/”).recursiveGlob(“box*”, filter=hou.nodeTypeFilter.NoFilter) –> /obj/box1 /obj/geo/box1 /shop/box_material etc
More help:
http://www.sidefx.com/docs/houdini15.0/hom/hou/Node [sidefx.com]
hope this helps,
skk.
- AlchemistRS
- Member
- 10 posts
- Joined: Jan. 2015
- Offline
Thanks SYmek I tried what you said and a few others from the link you gave me,but did not work. Here is the last piece at the end of code that I need to convert out of the 1998 lines. I did not write the code just converting it.Symek can you take a look please?
mc = hou
if mc.objExists('HDR_IMG'):
renderResolutionValue = mc.getAttr('HDR_IMG.renderResolution')
else:
renderResolutionValue = 2
if mc.objExists('HDR_IMG'):
renderQualityValue = mc.getAttr('HDR_IMG.qualityPreset')
else:
renderQualityValue = 2
if mc.objExists('HDR_IMG'):
plateModeValue = mc.getAttr('HDR_IMG.plateMode')
else:
plateModeValue = 1
if mc.objExists('HDR_IMG'):
envModeValue = mc.getAttr('HDR_IMG.envMode')
else:
envModeValue = 1
if mc.objExists('HDR_IMG'):
colorMappingModeValue = mc.getAttr('HDR_IMG.cmMode')
else:
colorMappingModeValue = 2
mc = hou
if mc.objExists('HDR_IMG'):
renderResolutionValue = mc.getAttr('HDR_IMG.renderResolution')
else:
renderResolutionValue = 2
if mc.objExists('HDR_IMG'):
renderQualityValue = mc.getAttr('HDR_IMG.qualityPreset')
else:
renderQualityValue = 2
if mc.objExists('HDR_IMG'):
plateModeValue = mc.getAttr('HDR_IMG.plateMode')
else:
plateModeValue = 1
if mc.objExists('HDR_IMG'):
envModeValue = mc.getAttr('HDR_IMG.envMode')
else:
envModeValue = 1
if mc.objExists('HDR_IMG'):
colorMappingModeValue = mc.getAttr('HDR_IMG.cmMode')
else:
colorMappingModeValue = 2
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
-
- Quick Links