コード例 #1
0
ファイル: royalRifle.py プロジェクト: michimussato/pypelyne2
 def addRenderJobEntities(self, submissionJob, project, renderData):
     """ method will add a render job entity. It will be called by submitRender.
         
         :param submissionJob: dictionary of the submit entity with at least 'type',  'id' and 'code' key
         :type submissionJob: dict
         :param project: dictionary of the project entity with at least 'type' and 'id' key
         :type project: dict
         :param renderData: dictionary with attributes, which should be set to the render and submit entities.
                 as keys you can use any attribute listed in the config file and all default attribute names loke code, description etc
                 The containing values have to be in the correct data-type
         :type renderData: dict
         
         :returns: the created render entity in shotgun
         :rtype: dict
     """
     
     creationDict = {}
     
     # debug and cleanup renderData dict
     if not renderData.has_key('job_id'):
         raise RoyalRifleException('renderData dictionary needs job_id value')
     
     if renderData.has_key('project'):
         renderData.pop('project')
     if renderData.has_key('sequence'):
         renderData.pop('sequence')
     if renderData.has_key('shot'):
         renderData.pop('shot')
     if renderData.has_key('task'):
         renderData.pop('task')
     if renderData.has_key('code'):
         renderData.pop('code')
     
     description = renderData.get('description', '')
     
     # fill creationDict with correct values
     allEntityFieldNames = [each['name'] for each in entityConfig.jobEntityFields]
     for eachFieldName, eachFieldValue in renderData.items():
         if not eachFieldName in allEntityFieldNames:
             continue
         creationDict['%s%s'%(self._sgAttrPrefix, eachFieldName)] = eachFieldValue
     
     creationDict['project'] = project
     creationDict['code'] = '%s_%s'%(submissionJob['code'], renderData['job_id'])
     creationDict['description'] = description
     creationDict['%sstatus_list'%self._sgAttrPrefix] = 'ip'
     
     # create new render entity
     renderEntity = self.sg.create(rrSG.entityJob(), creationDict, ['type', 'id', 'code'])
     
     return renderEntity
コード例 #2
0
ファイル: royalRifle.py プロジェクト: michimussato/pypelyne2
    def _updateRenderEntity(self, id, renderEntity):
        """ method will update the render entity with the given id.
            
            :param id: id of the render entity to be searched for
            :type id: int

            :param renderEntity: renderEntity retrieved with _findRenderEntity
            :type renderEntity: renderEntity
            
        """
        self.sg.update(
                        rrSG.entityJob(),
                        id,
                        renderEntity
                    )
コード例 #3
0
ファイル: royalRifle.py プロジェクト: michimussato/pypelyne2
 def getRenderEntityFromRRJobId(self, rrJobId):
     """ method will returnthe dictionary of the render entity in Shotgun, which is linked to the given royalRender job id
         
         :param rrJobId: render job id in Royal Render
         :type rrJobId: int
         
         :returns: the shotgun render entity in shotgun
         :rtype: dict
     """
     
     # create shotgun entity instance
     minimalRenderEntity = self.sg.find_one(rrSG.entityJob(),
                     filters=[['%sjob_id'%self._sgAttrPrefix, 'is', rrJobId]])
     
     renderEntity = self._findRenderEntity(minimalRenderEntity['id'])
     
     return renderEntity
コード例 #4
0
ファイル: royalRifle.py プロジェクト: michimussato/pypelyne2
 def _findRenderEntity(self, id):
     """ method will returns the render entity with the given id.
         
         :param id: id of the render entity to be searched for
         :type id: int
         
         :returns: the found render entity with all attributes and their values in the dictionary
         :rtype: dict
     """
     
     fieldList = ['%s%s'%(self._sgAttrPrefix, each['name']) for each in entityConfig.jobEntityFields]
     fieldList.extend(['id', 'type', 'project', 'code', 'description'])
     
     renderEntity = self.sg.find_one(
                     rrSG.entityJob(),
                     filters=[['id', 'is', id]],
                     fields=fieldList
                 )
     
     if not renderEntity:
         raise RoyalRifleException('renderEntity %s not in shotgun database!'%id)
     return renderEntity
コード例 #5
0
ファイル: royalRifle.py プロジェクト: michimussato/pypelyne2
 def setRenderEntityState(self, id, newStatus):
     """ method changes the status of a render entity based on the current status
         
         status of a submit entity::
             
             'rev'       =       if all linked render entities are set to review
             'cmpt'      =       if all linked render entities are set to complete
             'ip'            =       in any other case
         
         :param submitEntity: submit entity in shotgun
         :type submitEntity: dict
         
         :returns: the state the submit entity has been set to.
         :rtype: string
     """
     
     self.sg.update(
                     rrSG.entityJob(),
                     id,
                     {'%sstatus_list'%self._sgAttrPrefix:newStatus}
             )
     return newStatus            
コード例 #6
0
		},
		{'type' : 'entity',
			'name' : 'linked_shot',
			'input' : {'valid_types':['Shot']}
		},
		{'type' : 'entity',
			'name' : 'linked_task',
			'input' : {'valid_types':['Task']}
		},
		{'type' : 'entity',
			'name' : 'linked_user',
			'input' : {'valid_types':['HumanUser']}
		},
		{'type' : 'multi_entity',
			'name' : 'linked_jobs',
			'input' : {'valid_types':[rrSG.entityJob()]}
		},
		{'type' : 'text',
			'name' : 'render_application',
		},
		{'type' : 'url',
			'name' : 'render_scene_name',
			'input' : {'open_in_new_window': True},
		},
	]


jobEntityFields = [
		{'type' : 'entity',
			'name' : 'linked_submit_entity',
			'input' : {'valid_types':[rrSG.entitySubmit()]}