コード例 #1
0
def getPClass(host):
    """
    Return the base class for plugin type provided.

    @type  host: string
    @param host: name of the host application

    @rtype:   Class
    @return:  the specific ui class
    """
    if host == 'blender24':
        from upy.blender.v249 import blenderPlugin as plugClass
    elif host == 'blender25':
        import bpy
        blender_version = bpy.app.version
        if blender_version < (2, 60, 0):
            from upy.blender.v257 import blenderPlugin as plugClass
        elif blender_version >= (2, 60, 0) and blender_version < (2, 63,
                                                                  0):  #2.62
            from upy.blender.v262 import blenderPlugin as plugClass
        elif blender_version >= (2, 63, 0) and blender_version < (2, 71,
                                                                  0):  #2.63
            from upy.blender.v263 import blenderPlugin as plugClass
        elif blender_version >= (2, 63, 0) and blender_version < (2, 80,
                                                                  0):  #2.63
            from upy.blender.v271 import blenderPlugin as plugClass
        elif blender_version >= (2, 80, 0):
            from upy.blender.v280 import blenderPlugin as plugClass
        else:
            print(blender_version, blender_version < (2, 80, 0))
    elif host == 'c4d':
        import c4d
        c4d_version = c4d.GetC4DVersion()
        if c4d_version > 12000 and c4d_version < 13000:
            from upy.cinema4d.r12 import c4dPlugin as plugClass
        elif c4d_version > 13000 and c4d_version < 14000:
            from upy.cinema4d.r13 import c4dPlugin as plugClass
        elif c4d_version > 14000 and c4d_version < 20000:
            from upy.cinema4d.r14 import c4dPlugin as plugClass
        elif c4d_version > 20000:
            from upy.cinema4d.r20 import c4dPlugin as plugClass
    elif host == 'maya':
        from upy.autodeskmaya import mayaPlugin as plugClass
    elif host == 'softimage':
        from siutils import si
        Application = si()
        if type(Application) == unicode:
            import sipyutils
            Application = sipyutils.si()
        v = Application.version()
        if v >= (11, 0, 525, 0):
            from upy.softimage.v2013 import softimagePlugin as plugClass
    elif host == '3dsmax':
        import MaxPlus
        release = MaxPlus.Core.EvalMAXScript("getDir #maxData").Get()
        #from upy.autodesk3dsmax.v2013.maxUI import maxUIDialog as adaptor
        if release.find("2015") != -1:
            from upy.autodesk3dsmax.v2015 import maxPlugin as plugClass
        elif release.find("2016") != -1:
            from upy.autodesk3dsmax.v2016 import maxPlugin as plugClass
        else:
            print(release)
            print("not suppported")
            plugClass = None
    elif host == 'dejavu':
        from upy.dejavuTk import dejavuPlugin as plugClass
    elif host == 'chimera':
        from upy.ucsfchimera import chimeraPlugin as plugClass
    elif host == 'houdini':
        from upy.houdini import houdiniPlugin as plugClass
    else:
        plugClass = None
    return plugClass
コード例 #2
0
def getHClass(host):
    """
    Return the base class for modelling design according the provide host.

    @type  host: string
    @param host: name of the host application

    @rtype:   Class
    @return:  the specific ui class
    """
    #print globals()
    if host == 'blender24':
        from upy.blender.v249.blenderHelper import blenderHelper as helper
    elif host == 'blender25':
        import bpy
        blender_version = bpy.app.version
        if blender_version < (2, 60, 0):
            from upy.blender.v257.blenderHelper import blenderHelper as helper
        elif blender_version >= (2, 60, 0) and blender_version < (2, 63, 0):
            from upy.blender.v262.blenderHelper import blenderHelper as helper
        elif blender_version >= (2, 63, 0) and blender_version < (2, 71, 0):
            from upy.blender.v263.blenderHelper import blenderHelper as helper
        elif blender_version >= (2, 71, 0) and blender_version < (2, 78, 0):
            from upy.blender.v271.blenderHelper import blenderHelper as helper
        elif blender_version >= (2, 80, 0):
            from upy.blender.v280.blenderHelper import blenderHelper as helper
        else:
            print(blender_version)
    elif host == 'c4d':
        import c4d
        c4d_version = c4d.GetC4DVersion()
        if c4d_version > 12000 and c4d_version < 13000:
            from upy.cinema4d.r12.c4dHelper import c4dHelper as helper
        elif c4d_version > 13000 and c4d_version < 14000:
            from upy.cinema4d.r13.c4dHelper import c4dHelper as helper
        elif c4d_version > 14000 and c4d_version < 20000:
            from upy.cinema4d.r14.c4dHelper import c4dHelper as helper
        elif c4d_version > 20000:
            from upy.cinema4d.r20.c4dHelper import c4dHelper as helper
    elif host == 'maya':
        from upy.autodeskmaya.mayaHelper import mayaHelper as helper
    elif host == 'softimage':
        from siutils import si
        Application = si()
        if type(Application) == unicode:
            import sipyutils
            Application = sipyutils.si()
        v = Application.version()
        if v >= (11, 0, 525, 0):
            from upy.softimage.v2013.softimageHelper import softimageHelper as helper
    elif host == '3dsmax':
        import MaxPlus
        release = MaxPlus.Core.EvalMAXScript("getDir #maxData").Get()
        #from upy.autodesk3dsmax.v2013.maxUI import maxUIDialog as adaptor
        if release.find("2015") != -1:
            from upy.autodesk3dsmax.v2015.maxHelper import maxHelper as helper
        elif release.find("2016") != -1:
            from upy.autodesk3dsmax.v2016.maxHelper import maxHelper as helper
        else:
            print(release)
            print("not suppported")
            helper = None
    elif host == 'dejavu':
        from upy.dejavuTk.dejavuHelper import dejavuHelper as helper
    elif host == 'chimera':
        from upy.ucsfchimera.chimeraHelper import chimeraHelper as helper
    elif host == 'houdini':
        from upy.houdini.houdiniHelper import houdiniHelper as helper
    else:
        helper = None
    return helper
コード例 #3
0
def getUClass(host, pref=None):
    """
    Return the base class for UI design according the provide host.

    @type  host: string
    @param host: name of the host application
    @type  pref: string
    @param pref: UI interface prefernce for instance qt

    @rtype:   Class
    @return:  the specific ui class
    """
    if host == 'blender24':
        #check version
        #        from pyubic.blender.blenderUI import blenderUIDialog as adaptor
        from upy.blender.v249.blenderUI import blenderUIDialog as adaptor
    elif host == 'blender25':
        import bpy
        blender_version = bpy.app.version
        if blender_version < (2, 60, 0):
            from upy.blender.v257.blenderUI import blenderUIDialog as adaptor
        elif blender_version >= (2, 60, 0) and blender_version < (2, 63,
                                                                  0):  #2.62
            from upy.blender.v262.blenderUI import blenderUIDialog as adaptor
        elif blender_version >= (2, 63, 0) and blender_version < (
                2, 71, 0):  #2.63 and more
            from upy.blender.v263.blenderUI import blenderUIDialog as adaptor
        elif blender_version >= (2, 71, 0) and blender_version < (
                2, 80, 0):  #(2, 80, 0)
            from upy.blender.v271.blenderUI import blenderUIDialog as adaptor
        elif blender_version >= (2, 80, 0):
            from upy.blender.v280.blenderUI import blenderUIDialog as adaptor
        else:
            print(blender_version, blender_version < (2, 71, 0))
    elif host == 'c4d':
        import c4d
        c4d_version = c4d.GetC4DVersion()
        if c4d_version > 12000 and c4d_version < 13000:
            from upy.cinema4d.r12.c4dUI import c4dUIDialog as adaptor
        elif c4d_version > 13000 and c4d_version < 14000:
            from upy.cinema4d.r13.c4dUI import c4dUIDialog as adaptor
        elif c4d_version > 14000 and c4d_version < 20000:
            from upy.cinema4d.r14.c4dUI import c4dUIDialog as adaptor
        elif c4d_version >= 20000:
            from upy.cinema4d.r20.c4dUI import c4dUIDialog as adaptor
    elif host == 'maya':
        from upy.autodeskmaya.mayaUI import mayaUIDialog as adaptor
    elif host == 'softimage':
        from siutils import si
        Application = si()
        if type(Application) == unicode:
            import sipyutils
            Application = sipyutils.si()
        v = Application.version()
        if v >= (11, 0, 525, 0):
            #from upy.softimage.v2013.softimageUI import softimageUIDialog as adaptor
            from upy.pythonUI.qtUI import qtUIDialog as adaptor
    elif host == '3dsmax':
        import MaxPlus
        release = MaxPlus.Core.EvalMAXScript("getDir #maxData").Get()
        #from upy.autodesk3dsmax.v2013.maxUI import maxUIDialog as adaptor
        if release.find("2015") != -1:
            from upy.autodesk3dsmax.v2015.maxUI import maxUI as adaptor
        elif release.find("2016") != -1:
            from upy.autodesk3dsmax.v2016.maxUI import maxUI as adaptor
        else:
            print(release)
            print("not suppported")
            adaptor = None
    elif host == 'dejavu':
        from upy.dejavuTk.dejavuUI import dejavuUIDialog as adaptor
#        print ("ok",adaptor)
    elif host == 'houdini':
        if pref is not None:
            if pref == "qt":
                from upy.pythonUI.qtUI import qtUIDialog as adaptor
            else:
                from upy.houdini.houdiniUI import houdiniUIDialog as adaptor


##        elif host == 'chimera':
#            from ePMV.Chimera.chimeraUI import chimeraAdaptor as uiadaptor
#        elif host == 'houdini':
#            from ePMV.houdini.houdiniUI import houdiniAdaptor as uiadaptor
    elif host == "qt":
        from upy.pythonUI.qtUI import qtUIDialog as adaptor
    else:
        adaptor = None
    return adaptor
コード例 #4
0
def getPClass(host):
    """
    Return the base class for plugin type provided.
        
    @type  host: string
    @param host: name of the host application
    
    @rtype:   Class
    @return:  the specific ui class
    """     
    if host == 'blender24':
        from upy.blender.v249 import blenderPlugin as plugClass
    elif host == 'blender25':
        import bpy
        blender_version = bpy.app.version
        if blender_version < (2,60,0):
            from upy.blender.v257 import blenderPlugin as plugClass
        elif blender_version >= (2,60,0) and blender_version < (2,63,0): #2.62
            from upy.blender.v262 import blenderPlugin as plugClass
        elif blender_version >= (2,63,0) and blender_version < (2,71,0): #2.63
            from upy.blender.v263 import blenderPlugin as plugClass
        elif blender_version >= (2,63,0): #2.63
            from upy.blender.v271 import blenderPlugin as plugClass
        else :
            print (blender_version,blender_version < (2,60,0))
    elif host=='c4d':
        import c4d
        c4d_version = c4d.GetC4DVersion()
        if c4d_version > 12000 and c4d_version < 13000:
            from upy.cinema4d.r12 import c4dPlugin as plugClass
        elif c4d_version > 13000 and c4d_version < 14000:
            from upy.cinema4d.r13 import c4dPlugin as plugClass
        elif c4d_version > 14000:
            from upy.cinema4d.r14 import c4dPlugin as plugClass
    elif host=='maya':
        from upy.autodeskmaya import mayaPlugin as plugClass
    elif host=='softimage':
        from  siutils import si
        Application = si()        
        if type(Application) == unicode :
            import sipyutils
            Application = sipyutils.si()
        v = Application.version()
        if v >= (11,0,525,0) :
            from upy.softimage.v2013 import softimagePlugin as plugClass
    elif host=='3dsmax':
        import MaxPlus
        release = MaxPlus.Core.EvalMAXScript("getDir #maxData").Get()
        #from upy.autodesk3dsmax.v2013.maxUI import maxUIDialog as adaptor
        if release.find("2015") != -1 :
            from upy.autodesk3dsmax.v2015 import maxPlugin as plugClass
        elif release.find("2016") != -1 :
            from upy.autodesk3dsmax.v2016 import maxPlugin as plugClass   
        else :
            print (release)
            print ("not suppported")
            plugClass = None                  
    elif host=='dejavu':
        from upy.dejavuTk import dejavuPlugin as plugClass
    elif host == 'chimera':
        from upy.ucsfchimera import chimeraPlugin as plugClass
    elif host == 'houdini': 
        from upy.houdini import houdiniPlugin as plugClass
    else :
        plugClass = None
    return plugClass    
コード例 #5
0
def getHClass(host):
    """
    Return the base class for modelling design according the provide host.
        
    @type  host: string
    @param host: name of the host application
    
    @rtype:   Class
    @return:  the specific ui class
    """
    #print globals()
    if host == 'blender24':
        from upy.blender.v249.blenderHelper import blenderHelper as helper
    elif host == 'blender25':
        import bpy
        blender_version = bpy.app.version
        if blender_version < (2,60,0):
            from upy.blender.v257.blenderHelper import blenderHelper as helper
        elif blender_version >= (2,60,0) and blender_version < (2,63,0): #2.62
            from upy.blender.v262.blenderHelper import blenderHelper as helper
        elif blender_version >= (2,63,0) and blender_version < (2,71,0): #2.62
            from upy.blender.v263.blenderHelper import blenderHelper as helper
        elif blender_version >= (2,71,0): #2.62
            from upy.blender.v271.blenderHelper import blenderHelper as helper
        else :
            print (blender_version)
    elif host=='c4d':
        import c4d
        c4d_version = c4d.GetC4DVersion()
        if c4d_version > 12000 and c4d_version < 13000:
            from upy.cinema4d.r12.c4dHelper import c4dHelper as helper
        elif c4d_version > 13000 and c4d_version < 14000:
            from upy.cinema4d.r13.c4dHelper import c4dHelper as helper
        elif c4d_version > 14000:
            from upy.cinema4d.r14.c4dHelper import c4dHelper as helper
    elif host=='maya':
        from upy.autodeskmaya.mayaHelper import mayaHelper as helper
    elif host=='softimage':
        from  siutils import si
        Application = si()               
        if type(Application) == unicode :
            import sipyutils
            Application = sipyutils.si()
        v = Application.version()
        if v >= (11,0,525,0):
            from upy.softimage.v2013.softimageHelper import softimageHelper as helper
    elif host=='3dsmax':
        import MaxPlus
        release = MaxPlus.Core.EvalMAXScript("getDir #maxData").Get()
        #from upy.autodesk3dsmax.v2013.maxUI import maxUIDialog as adaptor
        if release.find("2015") != -1 :
            from upy.autodesk3dsmax.v2015.maxHelper import maxHelper as helper
        elif release.find("2016") != -1 :
            from upy.autodesk3dsmax.v2016.maxHelper import maxHelper as helper   
        else :
            print (release)
            print ("not suppported")
            helper = None        
    elif host=='dejavu':
        from upy.dejavuTk.dejavuHelper import dejavuHelper as helper
    elif host == 'chimera':
        from upy.ucsfchimera.chimeraHelper import chimeraHelper as helper
    elif host == 'houdini': 
        from upy.houdini.houdiniHelper import houdiniHelper as helper
    else :
        helper = None
    return helper    
コード例 #6
0
def getUClass(host,pref=None):
    """
    Return the base class for UI design according the provide host.
        
    @type  host: string
    @param host: name of the host application
    @type  pref: string
    @param pref: UI interface prefernce for instance qt
    
    @rtype:   Class
    @return:  the specific ui class
    """         
    if host == 'blender24':
        #check version
#        from pyubic.blender.blenderUI import blenderUIDialog as adaptor
        from upy.blender.v249.blenderUI import blenderUIDialog as adaptor
    elif host == 'blender25':
        import bpy
        blender_version = bpy.app.version
        if blender_version < (2,60,0):
            from upy.blender.v257.blenderUI import blenderUIDialog as adaptor
        elif blender_version >= (2,60,0) and blender_version < (2,63,0): #2.62
            from upy.blender.v262.blenderUI import blenderUIDialog as adaptor
        elif blender_version >= (2,63,0) and blender_version < (2,71,0): #2.63 and more
            from upy.blender.v263.blenderUI import blenderUIDialog as adaptor
        elif blender_version >= (2,71,0): #2.63 and more
            from upy.blender.v271.blenderUI import blenderUIDialog as adaptor
        else :
            print (blender_version,blender_version < (2,60,0))
    elif host=='c4d':
        import c4d
        c4d_version = c4d.GetC4DVersion()
        if c4d_version > 12000 and c4d_version < 13000 :
            from upy.cinema4d.r12.c4dUI import c4dUIDialog as adaptor
        elif c4d_version > 13000  and c4d_version < 14000:
            from upy.cinema4d.r13.c4dUI import c4dUIDialog as adaptor
        elif c4d_version > 14000:
            from upy.cinema4d.r14.c4dUI import c4dUIDialog as adaptor
    elif host=='maya':
        from upy.autodeskmaya.mayaUI import mayaUIDialog as adaptor
    elif host=='softimage':
        from  siutils import si
        Application = si()
        if type(Application) == unicode :
            import sipyutils
            Application = sipyutils.si()
        v = Application.version()
        if v >= (11,0,525,0):
            #from upy.softimage.v2013.softimageUI import softimageUIDialog as adaptor
            from upy.pythonUI.qtUI import qtUIDialog as adaptor          
    elif host=='3dsmax':
        import MaxPlus
        release = MaxPlus.Core.EvalMAXScript("getDir #maxData").Get()
        #from upy.autodesk3dsmax.v2013.maxUI import maxUIDialog as adaptor
        if release.find("2015") != -1 :
            from upy.autodesk3dsmax.v2015.maxUI import maxUI as adaptor
        elif release.find("2016") != -1 :
            from upy.autodesk3dsmax.v2016.maxUI import maxUI as adaptor            
        else :
            print (release)
            print ("not suppported")
            adaptor = None
    elif host=='dejavu':
        from upy.dejavuTk.dejavuUI import dejavuUIDialog as adaptor
#        print ("ok",adaptor)
    elif host=='houdini':
        if pref is not  None :
            if pref == "qt" :
                from upy.pythonUI.qtUI import qtUIDialog as adaptor        
            else :    
                from upy.houdini.houdiniUI import houdiniUIDialog as adaptor           
##        elif host == 'chimera':
#            from ePMV.Chimera.chimeraUI import chimeraAdaptor as uiadaptor
#        elif host == 'houdini':
#            from ePMV.houdini.houdiniUI import houdiniAdaptor as uiadaptor
    elif host =="qt" :
        from upy.pythonUI.qtUI import qtUIDialog as adaptor
    else :
        adaptor = None
    return adaptor