Esempio n. 1
0
    def _add_texture(self, current_node, path, attr=""):

        # if the path in the field does not exist, prepend it with the
        # file_rule_entry dir for textures or sourceImages
        if not os.path.exists(path):
            self.app = Maya.get()
            texture_dir1 = self.app.mel('workspace -q -fre "textures"')
            texture_dir2 = self.app.mel('workspace -q -fre "sourceImages"')
            exists = False
            if texture_dir1:
                path = '%s/%s' % (texture_dir1, path)
                exists = os.path.exists(path)
                if not exists:
                    print "WARNING: texture_path '%s' does not exist" % path
            if not exists and texture_dir2:
                path = '%s/%s' % (texture_dir2, path)
                exists = os.path.exists(path)
                if not exists:
                    print "WARNING: texture_path '%s' does not exist" % path
            if not exists:
                return

            # Note: Temporarily disabling until we get a change to really test
            # this.
            """
            for dir in self.global_dirs:
                filename = path
                mayaman_path = "%s/%s" %(dir, filename)
                if os.path.exists(mayaman_path):
                    path = mayaman_path
                    break
            else:
                print "WARNING: texture_path '%s' does not exist" % path
                return
            """
        if os.path.exists(path):
            self.texture_nodes.append(current_node)
            self.texture_paths.append(path)
            if not attr:
                attr = "ftn"
            self.texture_attrs.append(attr)
        else:
            print "WARNING: texture_path '%s' does not exist" % path
Esempio n. 2
0
    def _add_texture(my, current_node, path, attr=""):

        # if the path in the field does not exist, prepend it with the 
        # file_rule_entry dir for textures or sourceImages
        if not os.path.exists(path):
            my.app = Maya.get()
            texture_dir1 = my.app.mel('workspace -q -fre "textures"')
            texture_dir2 = my.app.mel('workspace -q -fre "sourceImages"')
            exists = False
            if texture_dir1:
                path = '%s/%s' %(texture_dir1, path)
                exists = os.path.exists(path)
                if not exists:
                    print "WARNING: texture_path '%s' does not exist" % path
            if not exists and texture_dir2:
                path = '%s/%s' %(texture_dir2, path)
                exists = os.path.exists(path)
                if not exists:
                    print "WARNING: texture_path '%s' does not exist" % path
            if not exists:
                return

            # Note: Temporarily disabling until we get a change to really test
            # this.
            """
            for dir in my.global_dirs:
                filename = path
                mayaman_path = "%s/%s" %(dir, filename)
                if os.path.exists(mayaman_path):
                    path = mayaman_path
                    break
            else:
                print "WARNING: texture_path '%s' does not exist" % path
                return
            """
        if os.path.exists(path):
            my.texture_nodes.append( current_node )
            my.texture_paths.append( path )
            if not attr:
                attr = "ftn"
            my.texture_attrs.append( attr )
        else:
            print "WARNING: texture_path '%s' does not exist" % path
Esempio n. 3
0
 def __init__(self):
     self.env = MayaEnvironment.get()
     self.app = Maya.get()
Esempio n. 4
0
 def __init__(self):
     self.env = MayaEnvironment.get()
     self.app = Maya.get()
Esempio n. 5
0
 def __init__(my):
     my.env = MayaEnvironment.get()
     my.app = Maya.get()