def test_cellPACK():
    import upy
    upy.setUIClass()  #set the class
    from autopack import Gui
    afgui = Gui.AutoPackGui()
    afgui.setup(rep="af", host=upy.host)
    afgui.display()
    #create an empty object call "welcome to epmv ?"
    afobj = afgui.helper.newEmpty("Welcome to autoPack")
示例#2
0
文件: template.py 项目: corredD/upy
"""
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 17 10:23:24 2011

@author: -
"""
#example for a script not a plugin ....

import sys,os
#pyubic have to be in the pythonpath, if not add it
pathtoupy = "/Users/ludo/DEV/"
sys.path.insert(0,pathtoupy)

import upy
upy.setUIClass()
from upy import uiadaptor

#get the CGhelper
helperClass = upy.getHelperClass()



class template(uiadaptor):
    def setup(self):
        self.w = 200 
        #define all the widget we want
        self.initWidget(id=10)
        #setup the layout organisation of the define widget
        self.setupLayout()
        #is it a subwindow
示例#3
0
bpath = bpy.app.binary_path
if sys.platform == "win32":
    os.chdir(os.path.dirname(bpath))
    softdir = os.path.abspath(os.path.curdir)
elif  sys.platform == "darwin":
    os.chdir(os.path.dirname(bpath))
    os.chdir("../../../")
    softdir = os.path.abspath(os.path.curdir)
MGL_ROOT =softdir
upypath = softdir+"/MGLToolsPckgs"#"/Library/MGLTools/1.5.6.up/MGLToolsPckgs"
sys.path.insert(0,upypath)
sys.path.append(MGL_ROOT+'/MGLToolsPckgs/PIL')

import upy
upy.setUIClass('blender2.5')

class launchEPMV(bpy.types.Operator):
    bl_idname = "epmv.launch"
    bl_label = "ePMV"
    
    def execute(self, context):
        from ePMV import epmvGui
        epmvgui = epmvGui.epmvGui()
        epmvgui.setup(rep="epmv",mglroot=MGL_ROOT,host='blender25')
        ##
        #define the default options
        epmvgui.epmv.Set(bicyl=True,use_progressBar = False,doLight = True,doCamera = True,
                        useLog = False,doCloud=False,forceFetch=False)
        epmvgui.display()
        #create an empty object call "welcome to epmv ?"
示例#4
0
    if sys.platform == "win32":
        sys.path.append(MGL_ROOT+'/MGLToolsPckgs/PIL')
    else :
        #sys.path.insert(1,sys.path[0]+"/lib-tk")
        sys.path.insert(0,MGL_ROOT+'/lib/')
        sys.path.insert(0,MGL_ROOT+'/lib/python2.7/')
        sys.path.insert(0,MGL_ROOT+'/lib/python2.7/site-packages')
        sys.path.insert(0,MGL_ROOT+'/lib/python2.7/site-packages/PIL')
else :
    sys.path.append(MGL_ROOT+'/MGLToolsPckgs/PIL')
    sys.path.insert(1,MGL_ROOT+'/MGLToolsPckgs/lib-tk')
kPluginCmdName = "ePMV"
print kPluginCmdName

import upy
upy.setUIClass('maya')
from ePMV import epmvGui

# command
class scriptedCommand(OpenMayaMPx.MPxCommand):
    def __init__(self):
        OpenMayaMPx.MPxCommand.__init__(self)
    def doIt(self,argList):
        print argList
        epmvui = epmvGui.epmvGui()
        epmvui.setup(rep="epmv",mglroot=MGL_ROOT,host='maya')
        epmvui.epmv.Set(bicyl=True,use_progressBar = False,doLight = True,doCamera = True,
                useLog = False,doCloud=False,forceFetch=False)
        epmvui.CreateLayout()

# Creator
示例#5
0
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 29 13:09:18 2010

@author: Ludovic Autin
"""

#example for a script not a plugin ....
import sys
#pyubic have to be in the pythonpath, if not add it
pathtoupy = "/Users/ludo/DEV/"
sys.path.insert(0, pathtoupy)

import upy

upy.setUIClass("qt")
#this will automatically recognize the host and define the class uiadaptor
#from upy.pythonUI.qtUI import qtUIDialog as uiadaptor
from upy import uiadaptor
#but you can directly import the one you want like :
#from pyubic.dejavuTk.tkUI import tkUIDialog as uiadaptor
#from pyubic.blender.blenderUI import blenderUIDialog as uiadaptor
print(upy)
print(uiadaptor)
print(uiadaptor.__init__)


class simpleButtonsGUI(uiadaptor):
    def setup(self):
        self.initWidget(id=10)
        self.setupLayout()
示例#6
0
import c4d
import upy
import os
import time
import thread
from c4d import utils

from upy import uiadaptor

upy.setUIClass()

# get the helperClass for modeling
helperClass = upy.getHelperClass()

from c4d import documents, plugins
#Welcome to the world of Python
#1: cell membrane
#2: dna
#3: structure
settings = [
    None,
    {
        'polygonReduction': .99,
        'smoothStrength': 1.0,
    },
    {
        'polygonReduction': .95,
        'smoothStrength': 1.0,
    },
    {
        'polygonReduction': .90,
示例#7
0
文件: ePMVPlugin.py 项目: skcsd/ePMV
    import upy
except:
    found = False
if not found:
    #ys.path.append(__sipath__+'/MGLToolsPckgs/PIL')
    #sys.path.insert(0,__sipath__+'/MGLToolsPckgs/lib-tk')
    siutils.add_subfolder_to_syspath(__sipath__, '..\\MGLToolsPckgs')
    siutils.add_subfolder_to_syspath(__sipath__, '..\\MGLToolsPckgs\\PIL')
    siutils.add_subfolder_to_syspath(__sipath__, '..\\MGLToolsPckgs\\lib-tk')
    sys.path.append(__sipath__ + "\\..\\MGLToolsPckgs")
    MGL_ROOT = __sipath__ + "\\..\\MGLToolsPckgs"
else:
    MGL_ROOT = upy.__path__[0] + "\\..\\"
import ePMV
import upy
upy.setUIClass('qt')
from ePMV import epmvGui


def XSILoadPlugin(in_reg):
    in_reg.Author = "ludovic.autin"
    in_reg.Name = "ePMVPlugin"
    in_reg.Major = 1
    in_reg.Minor = 0

    in_reg.RegisterCommand("ePMV", "ePMV")
    #RegistrationInsertionPoint - do not remove this line
    in_reg.RegisterMenu(constants.siMenuMainApplicationToolbarsID, "ePMV_Menu",
                        false, false)
    return true
示例#8
0
#mgldirfile=prefpath+os.sep+"mgltoolsdir"
#local = False
#localpath = softdir+os.sep+"plug-ins"+os.sep+"MGLToolsPckgs"
#
###what about the path ?
##import c4d
##prefpath=c4d.storage.GeGetC4DPath(1)
##os.chdir(prefpath)
#os.chdir(".."+os.sep+"plugins"+os.sep+"autopack")
#plugdir = os.path.abspath(os.curdir)
#
#sys.path.append(plugdir)

#upy UIadaptor stuff
import upy
upy.setUIClass() #set the class
#get the pluginClass
plugTypeClass,opType = upy.getPluginClass(plug="command")#= operator in blender

from autopack import AFGui

class af_Dialog(plugTypeClass):
    plugin_name =  "autopack"
    plugin_id = PLUGIN_ID
    plugin_tooltip = "This is autopack"
    hasGui = True

    def setgui(self,dname):
        self.gui = AFGui.AFGui()
        self.gui.setup(rep=dname,host=upy.host)
        self.hasGui = True
示例#9
0
	import upy
except :
	found = False
if not found :
	#ys.path.append(__sipath__+'/MGLToolsPckgs/PIL')
	#sys.path.insert(0,__sipath__+'/MGLToolsPckgs/lib-tk')
	siutils.add_subfolder_to_syspath( __sipath__, '..\\MGLToolsPckgs' )
	siutils.add_subfolder_to_syspath( __sipath__, '..\\MGLToolsPckgs\\PIL' )
	siutils.add_subfolder_to_syspath( __sipath__, '..\\MGLToolsPckgs\\lib-tk' )
	sys.path.append(__sipath__+"\\..\\MGLToolsPckgs")
	MGL_ROOT=__sipath__+"\\..\\MGLToolsPckgs"
else :
	MGL_ROOT=upy.__path__[0]+"\\..\\"
import ePMV
import upy
upy.setUIClass('qt')
from ePMV import epmvGui

def XSILoadPlugin( in_reg ):
    in_reg.Author = "ludovic.autin"
    in_reg.Name = "ePMVPlugin"
    in_reg.Major = 1
    in_reg.Minor = 0

    in_reg.RegisterCommand("ePMV","ePMV")
    #RegistrationInsertionPoint - do not remove this line
    in_reg.RegisterMenu(constants.siMenuMainApplicationToolbarsID,"ePMV_Menu",false,false)
    return true

def XSIUnloadPlugin( in_reg ):
    strPluginName = in_reg.Name
示例#10
0
bpath = bpy.app.binary_path
if sys.platform == "win32":
    os.chdir(os.path.dirname(bpath))
    softdir = os.path.abspath(os.path.curdir)
elif  sys.platform == "darwin":
    os.chdir(os.path.dirname(bpath))
    os.chdir("../../../")
    softdir = os.path.abspath(os.path.curdir)
MGL_ROOT =softdir
upypath = softdir+"/MGLToolsPckgs"#"/Library/MGLTools/1.5.6.up/MGLToolsPckgs"
sys.path.insert(0,upypath)
sys.path.append(MGL_ROOT+'/MGLToolsPckgs/PIL')

import upy
upy.setUIClass('blender2.5')

class launchEPMV(bpy.types.Operator):
    bl_idname = "epmv.launch"
    bl_label = "ePMV"
    
    def execute(self, context):
        from ePMV import epmvGui
        epmvgui = epmvGui.epmvGui()
        epmvgui.setup(rep="epmv",mglroot=MGL_ROOT,host='blender25')
        ##
        #define the default options
        epmvgui.epmv.Set(bicyl=True,use_progressBar = False,doLight = True,doCamera = True,
                        useLog = False,doCloud=False,forceFetch=False)
        epmvgui.display()
        #create an empty object call "welcome to epmv ?"
示例#11
0
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 29 13:09:18 2010

@author: Ludovic Autin
"""

#example for a script not a plugin ....
import sys
#pyubic have to be in the pythonpath, if not add it
pathtoupy = "/Users/ludo/DEV/"
sys.path.insert(0,pathtoupy)

import upy
upy.setUIClass("qt")
#this will automatically recognize the host and define the class uiadaptor
#from upy.pythonUI.qtUI import qtUIDialog as uiadaptor
from upy import uiadaptor
#but you can directly import the one you want like :
#from pyubic.dejavuTk.tkUI import tkUIDialog as uiadaptor
#from pyubic.blender.blenderUI import blenderUIDialog as uiadaptor
print (upy)
print (uiadaptor)
print (uiadaptor.__init__)
class simpleButtonsGUI(uiadaptor):

    def setup(self):
        self.initWidget(id=10)
        self.setupLayout()
        
    #theses two function are for c4d
示例#12
0
    if sys.platform == "win32":
        sys.path.append(MGL_ROOT + '/MGLToolsPckgs/PIL')
    else:
        #sys.path.insert(1,sys.path[0]+"/lib-tk")
        sys.path.insert(0, MGL_ROOT + '/lib/')
        sys.path.insert(0, MGL_ROOT + '/lib/python2.7/')
        sys.path.insert(0, MGL_ROOT + '/lib/python2.7/site-packages')
        sys.path.insert(0, MGL_ROOT + '/lib/python2.7/site-packages/PIL')
else:
    sys.path.append(MGL_ROOT + '/MGLToolsPckgs/PIL')
    sys.path.insert(1, MGL_ROOT + '/MGLToolsPckgs/lib-tk')
kPluginCmdName = "ePMV"
print kPluginCmdName

import upy
upy.setUIClass('maya')
from ePMV import epmvGui


# command
class scriptedCommand(OpenMayaMPx.MPxCommand):
    def __init__(self):
        OpenMayaMPx.MPxCommand.__init__(self)

    def doIt(self, argList):
        print argList
        epmvui = epmvGui.epmvGui()
        epmvui.setup(rep="epmv", mglroot=MGL_ROOT, host='maya')
        epmvui.epmv.Set(bicyl=True,
                        use_progressBar=False,
                        doLight=True,