예제 #1
0
	def __allNodes( self, type = arnold.AI_NODE_ALL ) :
	
		result = []
		i = arnold.AiUniverseGetNodeIterator( type )
		while not arnold.AiNodeIteratorFinished( i ) :
			result.append( arnold.AiNodeIteratorGetNext( i ) )
	
		return result
예제 #2
0
	def __allNodes( self, type = arnold.AI_NODE_ALL, ignoreRoot = True ) :

		result = []
		i = arnold.AiUniverseGetNodeIterator( type )
		while not arnold.AiNodeIteratorFinished( i ) :
			node = arnold.AiNodeIteratorGetNext( i )
			if ignoreRoot and arnold.AiNodeEntryGetName( arnold.AiNodeGetNodeEntry( node ) ) == "list_aggregate" and arnold.AiNodeGetName( node ) == "root" :
				continue
			result.append( node )

		return result
예제 #3
0
    def __allNodes(self, type=arnold.AI_NODE_ALL, ignoreBuiltIn=True):

        result = []
        i = arnold.AiUniverseGetNodeIterator(type)
        while not arnold.AiNodeIteratorFinished(i):
            node = arnold.AiNodeIteratorGetNext(i)
            if ignoreBuiltIn and arnold.AiNodeGetName(node) in (
                    "root", "ai_default_reflection_shader"):
                continue
            result.append(node)

        return result
예제 #4
0
def render_ass(ass, remove_ass=False):
    imagefilename = None
    ai.AiBegin()
    ai.AiLoadPlugins(os.environ['ARNOLD_PLUGIN_PATH'])
    ai.AiASSLoad (ass, ai.AI_NODE_ALL)
    ai.AiRender()
    ai.AiEnd()
    # read out file
    ai.AiBegin()
    ai.AiMsgSetConsoleFlags(ai.AI_LOG_ALL)
    ai.AiASSLoad(ass, ai.AI_NODE_ALL)
    iter = ai.AiUniverseGetNodeIterator(ai.AI_NODE_ALL)
    while not ai.AiNodeIteratorFinished(iter):
        node = ai.AiNodeIteratorGetNext(iter)
        if ai.AiNodeIs( node, "driver_jpeg" ):
            imagefilename = ai.AiNodeGetStr( node, "filename" )
    ai.AiNodeIteratorDestroy(iter)
    ai.AiEnd()
    if remove_ass:
        os.remove(ass)
    return imagefilename