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


Python Project.get_naming方法代码示例

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


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

示例1: get_input_value

# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_naming [as 别名]
    def get_input_value(my, sobject, snapshot):
        ''' value of the loading checkbox''' 
        # use the naming
        naming = Project.get_naming("node")
        naming.set_sobject(sobject)
        naming.set_snapshot(snapshot)
        namespace = naming.get_value()
        instance = sobject.get_name()
        snap_node_name = snapshot.get_node_name()

        """
        # Currently, web state object is not rebuilt.
        shot_id = my.search_id
        if not shot_id:
            shot_id = WebState.get().get_state("shot_id")

        if shot_id == "":
            shot_id = WebContainer.get_web().get_form_value("shot_id")
        if shot_id == "":
            raise WidgetException("No shot found value passed in")
        """

         
        #shot = my.parent.get_shot()

        shot_code = my.parent.get_value("shot_code")

        value = "%s|%s|%s|%s|%s|%s" % (snapshot.get_code(), shot_code, \
                instance, snapshot.get_context(), namespace, snap_node_name)
        return value
开发者ID:0-T-0,项目名称:TACTIC,代码行数:32,代码来源:asset_loader_wdg.py

示例2: add_related_connection

# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_naming [as 别名]
    def add_related_connection(my, src_sobject, dst_sobject, src_path=None):
        '''adding the related sobject code to this current sobject''' 
        my.add_related_sobject(src_sobject)
        my.add_related_sobject(dst_sobject)


        #shot_col =  dst_sobject.get_foreign_key()
        schema = my.get_schema()
        st1 = my.get_base_search_type()
        st2 =  dst_sobject.get_base_search_type()
        relationship = schema.get_relationship(st1, st2)
        attrs = schema.get_relationship_attrs(st1, st2)
        
        from_col = attrs.get("from_col")

        search = Search( my.SEARCH_TYPE )
        search.add_filter(from_col,  dst_sobject.get_code())
        search.add_filter("type", "asset")
        search.add_filter("asset_code",  src_sobject.get_code())
        search.add_order_by('name desc')
        instances = search.get_sobjects()
        """
        # if it allows order by, I can switch to this
        filters = [('asset_code', src_sobject.get_code())]
        instances = dst_sobject.get_related_sobjects(my.SEARCH_TYPE, filters=filters)
        """
        naming = Project.get_naming("node")
        instance_name = naming.get_shot_instance_name(dst_sobject, src_sobject, instances)
        my.set_value('name', instance_name)
        my.set_value('type', 'asset')
开发者ID:0-T-0,项目名称:TACTIC,代码行数:32,代码来源:asset.py

示例3: create

# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_naming [as 别名]
    def create(cls, shot, asset, instance_name="", type="asset", unique=False):

        shot_col = shot.get_foreign_key()
        search = Search( cls.SEARCH_TYPE )
        search.add_filter(shot_col, shot.get_code())
        search.add_filter("type", type)
        #if unique:
        #    search.add_filter("name", instance_name)
        search.add_filter("asset_code", asset.get_code())
        search.add_order_by('name desc')
        sobjs = search.get_sobjects()

        # if unique and exists, then return
        if unique and sobjs:
            Environment.add_warning("Instance exists", "Shot '%s' already has an instance for asset '%s'" % (shot.get_code(), asset.get_code()) )
            return

        naming = Project.get_naming("node")
        instance_name = naming.get_shot_instance_name(shot, asset, sobjs)
        
        #instance_name = cls.get_instance_name(sobjs, instance_name) 
        
        instance = SObjectFactory.create( cls.SEARCH_TYPE )
        instance.set_value(shot_col,shot.get_code())
        instance.set_value("asset_code",asset.get_code())
        instance.set_value("name",instance_name)
        instance.set_value("type",type)

        instance.commit()
        return instance
开发者ID:0-T-0,项目名称:TACTIC,代码行数:32,代码来源:asset.py

示例4: get_namespace

# 需要导入模块: from pyasm.biz import Project [as 别名]
# 或者: from pyasm.biz.Project import get_naming [as 别名]
    def get_namespace(my, sobject, snapshot):
        ''' this is actually the namespace in Maya and node name in Houdini'''
        if not sobject:
            return ""

        naming = Project.get_naming("node") 
        naming.set_sobject(sobject)
        naming.set_snapshot(snapshot)
        instance = naming.get_value()
        return instance   
开发者ID:0-T-0,项目名称:TACTIC,代码行数:12,代码来源:asset_loader_wdg.py


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