本文整理匯總了Python中hou.StringParmTemplate方法的典型用法代碼示例。如果您正苦於以下問題:Python hou.StringParmTemplate方法的具體用法?Python hou.StringParmTemplate怎麽用?Python hou.StringParmTemplate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hou
的用法示例。
在下文中一共展示了hou.StringParmTemplate方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_spare_input
# 需要導入模塊: import hou [as 別名]
# 或者: from hou import StringParmTemplate [as 別名]
def create_spare_input(node, value=''):
"""creates spare inputs for the given node and sets the value
:param hou.Node node: The node to insert the spare input to.
:param str value: The value of the parameter
"""
# Create space input0 for rs proxy output node
parm_template_group = node.parmTemplateGroup()
parm_template_group.append(
hou.StringParmTemplate(
'spare_input0', 'Spare Input 0', 1,
string_type=hou.stringParmType.NodeReference
)
)
node.setParmTemplateGroup(parm_template_group)
node.parm('spare_input0').set(value)
示例2: createWedge
# 需要導入模塊: import hou [as 別名]
# 或者: from hou import StringParmTemplate [as 別名]
def createWedge(nName,nColor,sourcePath):
outRop = hou.node('/out').createNode('wedge',nName)
tpl = hou.StringParmTemplate("source", "Source", 1, string_type=hou.stringParmType.NodeReference)
outRop.addSpareParmTuple(tpl)
outRop.setParms({
"source" : sourcePath,
"prefix" : "",
"driver" : "`chs('source')`/To_Fetch",
"wedgeparams" : 1,
"random" : 0,
})
outRop.setParmExpressions({
"range1y" : 'ch("steps1")-1',
})
outRop.setColor(nColor)
return outRop
示例3: createAlembic
# 需要導入模塊: import hou [as 別名]
# 或者: from hou import StringParmTemplate [as 別名]
def createAlembic(nName,nColor,sourcePath):
outRop = hou.node('/out').createNode('alembic',nName)
tpl = hou.StringParmTemplate("source", "Source", 1, string_type=hou.stringParmType.NodeReference)
outRop.addSpareParmTuple(tpl)
outRop.parm('f1').deleteAllKeyframes()
outRop.parm('f2').deleteAllKeyframes()
outRop.setParms({
"use_sop_path" : 1,
"source" : sourcePath,
"sop_path" : "`chs('source')`/TO_ROP",
"filename" : "`chs(chsop('source')+'/filename')`",
"path_attrib" : "_nmAbcPath",
'full_bounds' : 1,
'facesets' : 0,
#"alfprogress" : 1,
})
outRop.setParmExpressions({
"trange" : "ch(chs('source')+'/abc_type')",
"f1" : "ch(chs('source')+'/f1')",
"f2" : "ch(chs('source')+'/f2')",
"f3" : "ch(chs('source')+'/f3')",
"build_from_path" : "ch(chsop('source')+'/build_hier_from_path')",
"facesets" :"ch(chsop('source')+'/facesets')",
#"initsim" : "ch(chs('source')+'/initsim')",
#"savebackground" : "ch(chs('source')+'/To_Fetch_savebackground')",
})
outRop.setColor(nColor)
return outRop
示例4: imprint
# 需要導入模塊: import hou [as 別名]
# 或者: from hou import StringParmTemplate [as 別名]
def imprint(node, data):
"""Store attributes with value on a node
Depending on the type of attribute it creates the correct parameter
template. Houdini uses a template per type, see the docs for more
information.
http://www.sidefx.com/docs/houdini/hom/hou/ParmTemplate.html
Args:
node(hou.Node): node object from Houdini
data(dict): collection of attributes and their value
Returns:
None
"""
parm_group = node.parmTemplateGroup()
parm_folder = hou.FolderParmTemplate("folder", "Extra")
for key, value in data.items():
if value is None:
continue
if isinstance(value, float):
parm = hou.FloatParmTemplate(name=key,
label=key,
num_components=1,
default_value=(value,))
elif isinstance(value, bool):
parm = hou.ToggleParmTemplate(name=key,
label=key,
default_value=value)
elif isinstance(value, int):
parm = hou.IntParmTemplate(name=key,
label=key,
num_components=1,
default_value=(value,))
elif isinstance(value, six.string_types):
parm = hou.StringParmTemplate(name=key,
label=key,
num_components=1,
default_value=(value,))
else:
raise TypeError("Unsupported type: %r" % type(value))
parm_folder.addParmTemplate(parm)
parm_group.append(parm_folder)
node.setParmTemplateGroup(parm_group)
示例5: createGeometry
# 需要導入模塊: import hou [as 別名]
# 或者: from hou import StringParmTemplate [as 別名]
def createGeometry(nName,nColor,sourcePath):
outRop = hou.node('/out').createNode('geometry',nName)
tpl = hou.StringParmTemplate("source", "Source", 1, string_type=hou.stringParmType.NodeReference)
outRop.addSpareParmTuple(tpl)
outRop.parm('f1').deleteAllKeyframes()
outRop.parm('f2').deleteAllKeyframes()
outRop.setColor(nColor)
outRop.setParms({
#"use_sop_path" : 1,
"source" : sourcePath ,
"soppath" : "`chs('source')`/TO_ROP",
"alfprogress" : 1,
})
outRop.setParmExpressions({
"trange" : "ch(chs('source')+'/trange')",
"f1" : "ch(chs('source')+'/f1')",
"f2" : "ch(chs('source')+'/f2')",
"f3" : "ch(chs('source')+'/f3')",
"sopoutput" : "chs(chsop('source')+'/To_Fetch/sopoutput')",
#"build_from_path" : "ch(chsop('source')+'/build_hier_from_path')"
"initsim" : "ch(chs('source')+'/initsim')",
"savebackground" : "ch(chs('source')+'/savebackground')",
})
if nName.startswith("Cache"):
outRop.setParms({
"prerender": "hou.node(hou.node('.').parm('source').eval()).hdaModule().pre_render( hou.node(hou.node('.').parm('source').eval()).path() )",
"lprerender":"python",
"postrender":"hou.node(hou.node('.').parm('source').eval()).hdaModule().post_render( hou.node(hou.node('.').parm('source').eval()).path() )",
"lpostrender":"python",
})
outRop.setParmExpressions({
"tpreframe": "ch(chs('source')+'/tpreframe')",
"preframe": "chs(chs('source')+'/preframe')",
"lpreframe": "ch(chs('source')+'/lpreframe')",
"tpostframe": "ch(chs('source')+'/tpostframe')",
"postframe": "chs(chs('source')+'/postframe')",
"lpostframe": "ch(chs('source')+'/lpostframe')",
"tpostwrite": "ch(chs('source')+'/tpostwrite')",
"postwrite": "chs(chs('source')+'/postwrite')",
"lpostwrite": "ch(chs('source')+'/lpostwrite')",
})
return outRop
示例6: process
# 需要導入模塊: import hou [as 別名]
# 或者: from hou import StringParmTemplate [as 別名]
def process(self, context, plugin):
import hou
# Get the errored instances
failed = []
for result in context.data["results"]:
if (result["error"] is not None and
result["instance"] is not None and
result["instance"] not in failed):
failed.append(result["instance"])
# Apply pyblish.logic to get the instances for the plug-in.
instances = api.instances_by_plugin(failed, plugin)
plugin = plugin()
for instance in instances:
node = instance[0]
templates = []
templates.append(hou.IntParmTemplate(
"deadlineChunkSize", "Chunk Size", 1, default_value=(1,)
))
templates.append(hou.IntParmTemplate(
"deadlinePriority", "Priority", 1, default_value=(50,)
))
templates.append(hou.StringParmTemplate(
"deadlinePool", "Pool", 1, default_value=("",)
))
templates.append(hou.IntParmTemplate(
"deadlineConcurrentTasks",
"Concurrent Tasks",
1,
default_value=(1,)
))
parm_group = node.parmTemplateGroup()
parm_folder = hou.FolderParmTemplate("folder", "Deadline")
for template in templates:
try:
parm_folder.addParmTemplate(template)
except:
self.log.debug("Could not add \"{0}\"".format(template))
parm_group.append(parm_folder)
node.setParmTemplateGroup(parm_group)