本文整理汇总了Python中hou.FolderParmTemplate方法的典型用法代码示例。如果您正苦于以下问题:Python hou.FolderParmTemplate方法的具体用法?Python hou.FolderParmTemplate怎么用?Python hou.FolderParmTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hou
的用法示例。
在下文中一共展示了hou.FolderParmTemplate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_top_level_folder
# 需要导入模块: import hou [as 别名]
# 或者: from hou import FolderParmTemplate [as 别名]
def make_top_level_folder(node, name, label):
"""
Creates a top level folder on a node and places all existing parameters and folders underneath it.
Args:
node (hou.RopNode): The ROP to modify
name (str): The parameter name of the folder
label (str): The label of the folder
Returns:
None
"""
parm_tg = node.parmTemplateGroup()
top_folder = hou.FolderParmTemplate(name, label, parm_tg.entries())
parm_tg.clear()
parm_tg.addParmTemplate(top_folder)
node.setParmTemplateGroup(parm_tg)
示例2: create_rop_parameters
# 需要导入模块: import hou [as 别名]
# 或者: from hou import FolderParmTemplate [as 别名]
def create_rop_parameters(script_args, farm_name, rop_node, error_list_obj=None):
"""
Creates parameters on a specific ROP and farm
Args:
script_args (dict): The Houdini "kwargs" dictionary
farm_name (str): Name of the farm integration. Lowercase. Must match the name of the farm module. E.g. "deadline"
rop_node (hou.Node): A ROP node (in any context)
error_list_obj (RopErrorList): An instance of RopErrorList class to store any errors or warnings
Returns:
Bool: True if successful, False if the parameter configuration can't be found
"""
with ErrorList(error_list_obj) as error_list_obj:
param_list = get_config_parameter_list(farm_name, rop_node)
if param_list is None:
err_msg = "Could not load '{0}' ROP {1} parameters from config".format(rop_node.type().name(), farm_name)
error_list_obj.add(ErrorMessage(err_msg))
return False
parm_list = create_parameters_from_list(param_list, farm_name)
farm_folder = hou.FolderParmTemplate("hf_{0}_folder".format(farm_name), farm_name.title(), parm_list)
rop_parm_template_group = rop_node.parmTemplateGroup()
rop_parm_template_group.append(farm_folder)
rop_node.setParmTemplateGroup(rop_parm_template_group)
return True
示例3: imprint
# 需要导入模块: import hou [as 别名]
# 或者: from hou import FolderParmTemplate [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)
示例4: process
# 需要导入模块: import hou [as 别名]
# 或者: from hou import FolderParmTemplate [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)