当前位置: 首页>>代码示例>>Python>>正文


Python hou.Node方法代码示例

本文整理汇总了Python中hou.Node方法的典型用法代码示例。如果您正苦于以下问题:Python hou.Node方法的具体用法?Python hou.Node怎么用?Python hou.Node使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hou的用法示例。


在下文中一共展示了hou.Node方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parse_container

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def parse_container(container):
    """Return the container node's full container data.

    Args:
        container (hou.Node): A container node name.

    Returns:
        dict: The container schema data for this container node.

    """
    data = lib.read(container)

    # Backwards compatibility pre-schemas for containers
    data["schema"] = data.get("schema", "avalon-core:container-1.0")

    # Append transient data
    data["objectName"] = container.path()
    data["node"] = container

    return data 
开发者ID:getavalon,项目名称:core,代码行数:22,代码来源:pipeline.py

示例2: genericTool

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def genericTool(scriptargs, nodetypename, nodename = None,
                isreusable = False, iscapture = False, allow_obj_sel=True,
                custom=False, merge_context=False, orient=None,
                exact_node_type = True,
                force_filter = False):
    """ Invokes a generic SOP tool.
        If isreusable is True, then the tool will try to reuse existing
        nodes of matching type in the network before creating any new nodes.
        If iscapture is True, then the tool is considered to be a capture-type
        tool.  Capture-type tools will attempt to create new nodes before
        any deform-type SOPs in the network.
        If merge_context is True, then we create the generator in context,
        while merging it together with the current display sop.
        If orient is set, it should be an instance of OrientInfo.
        If exact_node_type is True, it creates the node of the exact type 
        specified by nodetypename.  However, if exact_node_type is False, 
        then the base type may get resolved to another namespace or 
        another version, and the created node may be of that resolved type 
        (eg 'hda' may resolve to 'mynamespace::hda::2.0').
        If force_Filter is True, we will treat as a filter even if
        it can optionally have no inputs.
    """
    return hou.Node() 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:25,代码来源:soptoolutils.py

示例3: create_spare_input

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [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) 
开发者ID:eoyilmaz,项目名称:anima,代码行数:18,代码来源:auxiliary.py

示例4: patch_rop

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def patch_rop(script_args, farm_name, rop_node, error_list_obj=None):
    """
    Patches a ROP with spare parameters to allow for farm submission. Puts existing parameters underneath a
    top level folder, and patches it with the required farm parameter folder which contains parameters for submission.

    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) to patch
        error_list_obj (RopErrorList): An instance of RopErrorList class to store any errors or warnings

    Returns:
        Bool: True on success, otherwise False
    """
    with ErrorList(error_list_obj) as error_list_obj:

        if not is_rop_patchable(farm_name, rop_node):
            error_list_obj.add(WarningMessage("ROP nodes of type '{0}' not supported ".format(rop_node.type().name())))
            return False

        prepare_rop_for_new_parms(rop_node)
        create_rop_parameters(script_args, farm_name, rop_node, error_list_obj)
        return True 
开发者ID:fxnut,项目名称:hou_farm,代码行数:25,代码来源:tools.py

示例5: unpatch_rop

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def unpatch_rop(script_args, farm_name, rop_node, error_list_obj=None):
    """
    Undos the patching operation on a ROP. Removes the custom farm folder and parameters and moves the original
    parameters back up to the top level.

    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) to unpatch
        error_list_obj (RopErrorList): An instance of RopErrorList class to store any errors or warnings

    Returns:
        Bool: True if successfully removed, False if not
    """
    with ErrorList(error_list_obj) as error_list_obj:

        if remove_top_level_folders(rop_node, "hf_orig_parms", [farm_name.title()]) is False:
            error_list_obj.add(WarningMessage("Failed to un-patch: {0}".format(rop_node.path())))
            return False
        return True 
开发者ID:fxnut,项目名称:hou_farm,代码行数:22,代码来源:tools.py

示例6: get_node_folder_type_name

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def get_node_folder_type_name(rop_node):
    """
    Used to get a readable name for a ROP node. Used for the top level folder name. Currently only used on IFD
    Rops to call their top level folders "Mantra" instead of "Ifd"
    
    Args:
        rop_node (hou.Node): A ROP node (in any context) to provide the name for

    Returns:
        String: The readable name
    """
    folder_name = rop_node.type().name().title()

    regex = re.compile(r"((?P<company>[a-zA-Z.]*)::)?(?P<name>[a-zA-z_]+)(::(?P<version>[a-zA-Z0-9._]*))?")
    matches = regex.match(folder_name)
    if matches is not None:
        folder_name = matches.group("name")

    # Special cases for nodes where their type name is not a good folder label
    folder_name_dict = {"Ifd": "Mantra", 
                        "Baketexture": "Bake Texture"}
    if folder_name in folder_name_dict:
        folder_name = folder_name_dict[folder_name]

    return folder_name 
开发者ID:fxnut,项目名称:hou_farm,代码行数:27,代码来源:tools.py

示例7: get_config_parameter_list

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def get_config_parameter_list(farm_name, rop_node):
    """
    Retrieves the parameter layout for a particular farm integration and a particular node.

    Args:
        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)

    Returns:
        List: A list of parameter definitions
    """

    parm_list = get_node_parameter_list(farm_name, rop_node)
    if parm_list is None:
        return None
    include_dict = get_include_config_dict(farm_name)
    nodes_dict = get_nodes_config_dict(farm_name)
    return expand_json_include_blocks(nodes_dict, parm_list, include_dict) 
开发者ID:fxnut,项目名称:hou_farm,代码行数:20,代码来源:tools.py

示例8: set_config_parameter_list

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def set_config_parameter_list(farm_name, json_dict, rop_node, parameter_list):
    """
    Sets parameter data for a specified node and farm.

    Args:
        farm_name (str): Name of the farm integration. Lowercase. Must match the name of the farm module. E.g. "deadline"
        json_dict (dict): Hierarchical dictionary of values
        rop_node (hou.Node): A ROP node (in any context)
        parameter_list (list): Parameter list

    Returns:
        None
    """
    node_context = get_rop_context_name()
    node_type = rop_node.type().name()

    set_dict_path(json_dict, ["farm", farm_name, "nodes", node_context, node_type], parameter_list) 
开发者ID:fxnut,项目名称:hou_farm,代码行数:19,代码来源:tools.py

示例9: process

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def process(self):
        """This is the base functionality to create instances in Houdini

        The selected nodes are stored in self to be used in an override method.
        This is currently necessary in order to support the multiple output
        types in Houdini which can only be rendered through their own node.

        Default node type if none is given is `geometry`

        It also makes it easier to apply custom settings per instance type

        Example of override method for Alembic:

            def process(self):
                instance =  super(CreateEpicNode, self, process()
                # Set paramaters for Alembic node
                instance.setParms(
                    {"sop_path": "$HIP/%s.abc" % self.nodes[0]}
                )

        Returns:
            hou.Node

        """

        if (self.options or {}).get("useSelection"):
            self.nodes = hou.selectedNodes()

        # Get the node type and remove it from the data, not needed
        node_type = self.data.pop("node_type", None)
        if node_type is None:
            node_type = "geometry"

        # Get out node
        out = hou.node("/out")
        instance = out.createNode(node_type, node_name=self.name)
        instance.moveToGoodPosition()

        lib.imprint(instance, self.data)

        return instance 
开发者ID:getavalon,项目名称:core,代码行数:43,代码来源:pipeline.py

示例10: read

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def read(node):
    """Read the container data in to a dict

    Args:
        node(hou.Node): Houdini node

    Returns:
        dict

    """
    # `spareParms` returns a tuple of hou.Parm objects
    return {parameter.name(): parameter.eval() for
            parameter in node.spareParms()} 
开发者ID:getavalon,项目名称:core,代码行数:15,代码来源:lib.py

示例11: findDeformTypeInputSop

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def findDeformTypeInputSop(endnode):
    """ This function does a depth first traversal of the node
        input hierarchy to find the first deform-type node.
        Returns the deform-type node.  Returns None if no such node exists.
    """
    return hou.Node() 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:8,代码来源:soptoolutils.py

示例12: getGeometrySelections

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def getGeometrySelections(sceneviewer, selectors, allow_obj_selection=True,
                          prompt = None):
    """ This function invokes a geometry selection for each
        selector in "selectors".  The selector is not started, but
        its properties are used when calling sceneviewer.selectGeometry().
    """
    return (None,[], hou.Node()) 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:9,代码来源:soptoolutils.py

示例13: createSopNodeContainer

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def createSopNodeContainer(sceneviewer, newobjectname, merge_context = False,
                           merge_creator = None):
    """ Creates a scene level object node to contain a new SOP node.
        This function may return an existing object node if the Model in
        Context option is turned on, or the merge_context parameter is
        set to True.
    """
    return hou.Node() 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:10,代码来源:soptoolutils.py

示例14: createSopNodeFilter

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def createSopNodeFilter(container, nodetypename, nodename, exact_node_type):
    """ Creates a SOP node that takes an input. """
    # Look at the type of nodes that go inside the current node.
    return hou.Node() 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:6,代码来源:soptoolutils.py

示例15: createSopNodeGenerator

# 需要导入模块: import hou [as 别名]
# 或者: from hou import Node [as 别名]
def createSopNodeGenerator(container, nodetypename, nodename,
                           merge_context = False,
                           exact_node_type = True):
    """ Creates a SOP node that doesn't require an input. If the container
        already has nodes, this new SOP may be merged with the existing SOPs.
    """
    # Look at the type of nodes that go inside the current node.
    return hou.Node() 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:10,代码来源:soptoolutils.py


注:本文中的hou.Node方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。