(self, parent_code, nodes)
return info
NEW UPDATED METHOD: get a dictionary of file_path : (texture_code, node_name) list
NEW UPDATED METHOD: get a dictionary of file_path : (texture_code, node_name) list
NEW UPDATED METHOD : get a dictionary of file_path : ( texture_code node_name ) list
def _get_file_info_dict(self, parent_code, nodes):
        '''NEW UPDATED METHOD: get a dictionary of file_path : (texture_code, node_name) list'''
        info = {}
           
        for i, node in enumerate(nodes):
            path = Xml.get_attribute(node, "path")
            # and make it filesystem friendly
            filename = os.path.basename(path)
            filename = File.get_filesystem_name( filename )

            attr = Xml.get_attribute(node, "attr")
            node_name = Xml.get_attribute(node, "node")
            
            
            full_node_name = ''
            # for xsi:
            if attr == "SourceFileName":
                # xsi uses the full_node_name for description
                full_node_name = node_name
                tmp = node_name.split(".")
                try:
                    front_part = tmp[2:4]
                    front_part.append(tmp[-1]) 
                    
                    node_name = '_'.join(front_part)
                except IndexError:
                    raise TacticException('Expecting a node name in the form of'\
                        'node_name.mesh_name.Material.shading.file_node. Received [%s]' %node_name)
            else:
                # if there is a namespace, the split and take the last part
                # (for maya)
                node_name = node_name.split(":")[-1]

                # split this and take the last one in this path
                # (for Houdini paths)
                node_name = node_name.split("/")[-1]

            # shorten the texture code for maya ftn attributes or xsi ImageClips
            if not attr or attr in ["ftn" , "SourceFileName"]:
                texture_code = "%s-%s" % (parent_code, node_name)
            else:
                texture_code = "%s-%s-%s" % (parent_code, node_name, attr)
            
            # remove / in subcontext if any
            texture_code = texture_code.replace("/", "-")

            # keep this in sequence for use in add_dependecies
            self.texture_codes.append(texture_code)
           
            #local_path = "%s/%s" % (server_dir,filename)
            #sub_info = info.get(local_path)
            #new_md5 = File.get_md5(local_path)
            # texture codes part is not used any more
            info_list = info.get(filename.lower())
            if info_list:
                info_list.append((texture_code, node_name))
            else:
                info[filename.lower()] = [(texture_code, node_name)]
                
        return info
def _get_file_info_dict ( self , parent_code , nodes ) : info = { } for i , node in enumerate ( nodes ) : path = Xml . get_attribute ( node , "path" ) # and make it filesystem friendly filename = os . path . basename ( path ) filename = File . get_filesystem_name ( filename ) attr = Xml . get_attribute ( node , "attr" ) node_name = Xml . get_attribute ( node , "node" ) full_node_name = '' # for xsi: if attr == "SourceFileName" : # xsi uses the full_node_name for description full_node_name = node_name tmp = node_name . split ( "." ) try : front_part = tmp [ 2 : 4 ] front_part . append ( tmp [ - 1 ] ) node_name = '_' . join ( front_part ) except IndexError : raise TacticException ( 'Expecting a node name in the form of' 'node_name.mesh_name.Material.shading.file_node. Received [%s]' % node_name ) else : # if there is a namespace, the split and take the last part # (for maya) node_name = node_name . split ( ":" ) [ - 1 ] # split this and take the last one in this path # (for Houdini paths) node_name = node_name . split ( "/" ) [ - 1 ] # shorten the texture code for maya ftn attributes or xsi ImageClips if not attr or attr in [ "ftn" , "SourceFileName" ] : texture_code = "%s-%s" % ( parent_code , node_name ) else : texture_code = "%s-%s-%s" % ( parent_code , node_name , attr ) # remove / in subcontext if any texture_code = texture_code . replace ( "/" , "-" ) # keep this in sequence for use in add_dependecies self . texture_codes . append ( texture_code ) #local_path = "%s/%s" % (server_dir,filename) #sub_info = info.get(local_path) #new_md5 = File.get_md5(local_path) # texture codes part is not used any more info_list = info . get ( filename . lower ( ) ) if info_list : info_list . append ( ( texture_code , node_name ) ) else : info [ filename . lower ( ) ] = [ ( texture_code , node_name ) ] return info