def __init__(self, mapList=[]):
        self.window = mset.UIWindow(name='', register=False)
        self.rollout = mset.UIDrawer('Assign Material')
        self.rollout.open = True
        self.rollout.containedControl = self.window
        self.opendialog = Mset_showDialog(title='Select Texture Folder')
        self.btn_assingFromFolder = mset.UIButton(
            ('Assign From Folder').center(18, ' '))
        self.btn_assingFromSubfolder = mset.UIButton(
            ('From External Subfolder').center(5, ' '))
        self.affixlist = Mset_affixList(mapList=[
            'Normal', 'Roughness', 'BaseColor', 'Metallic', 'Specular',
            'Opacity'
        ])

        self.draw()

        self.controllers()
    def __init__(self, title='Path:', dialogtype='OpenFolder'):
        self.window = mset.UIWindow(name='', register=False)
        self.window.width = 280
        self.title = mset.UILabel(title)
        self.textField = mset.UITextField()
        self.button = mset.UIButton('....')
        self.button.small = True
        self.dialogtype = dialogtype

        self.draw()
        self.controllers()
    def __init__(self):
        self.window = mset.UIWindow(name='', register=False)
        self.rollout = mset.UIDrawer('Scene Info')
        self.rollout.open = False
        self.rollout.containedControl = self.window
        self.btn_refresh = mset.UIButton(('Refresh').center(80, ' '))
        self.btn_refresh.small = True
        self.object_counts = Mset_labelInfo(title='Object Count')
        self.material_counts = Mset_labelInfo(title='Materials Counts')
        self.trianglefaces = Mset_labelInfo(title='Triangle Faces Count')

        self.draw()

        self.controllers()
    for i in u_mats:
        checkbox = mset.UICheckBox()
        checkbox.label = i.name
        checks_list.append(checkbox)
        scrollbox_window.addReturn()
        scrollbox_window.addElement(checkbox)


def select_folder():
    folder_line.value = mset.showOpenFolderDialog()


folder_line = mset.UITextField()
folder_line.value = ''

folder_button = mset.UIButton()
folder_button.onClick = select_folder
folder_button.setIcon(
    os.path.abspath(
        os.path.join(os.curdir, "data/gui/control/materialgroupnew.tga")))

button_all = mset.UIButton()
button_all.onClick = select_all
button_all.text = 'All'

button_none = mset.UIButton()
button_none.onClick = deselcet_all
button_none.text = 'None'

button_scene = mset.UIButton()
button_scene.onClick = sunc_scene_materials
Beispiel #5
0
    print(mat_data["textureScale"])


## ui
window = mset.UIWindow("mar.pipe v.01")

#project_settings

settings_drawer_ui = mset.UIDrawer(name="Settings")
settings_drawer = mset.UIWindow(name="", register=False)
settings_drawer_ui.containedControl = settings_drawer
window.addElement(settings_drawer_ui)

#project dir
settings_drawer.addElement(mset.UILabel("project"))
file_button = mset.UIButton("...")
file_button.onClick = get_project_folder
settings_drawer.addElement(file_button)
project_folder_field = mset.UITextField()
project_folder_field.value = project_dir
settings_drawer.addElement(project_folder_field)

#material_dir
settings_drawer.addReturn()
settings_drawer.addElement(mset.UILabel("materials"))
file_button = mset.UIButton("...")
file_button.onClick = get_material_folder
settings_drawer.addElement(file_button)
material_folder_field = mset.UITextField()
material_folder_field.value = material_dir
settings_drawer.addElement(material_folder_field)
    def __init__(self):
        #### main window
        self.window = mset.UIWindow(name='', register=False)
        self.window.width = 280
        self.rollout = mset.UIDrawer('glTF Exporter')
        self.rollout.open = True
        self.rollout.containedControl = self.window

        #### single mode
        self.singlemode_window = mset.UIWindow(name='', register=False)
        self.singlemode_window.width = 280
        self.singlemode_rollout = mset.UIDrawer('Single Mode')
        self.singlemode_rollout.containedControl = self.singlemode_window
        self.singlemode_rollout.open = False
        self.singlemode_rollout.setMinor(False)

        self.dialog_signleexport = Mset_showDialog(title='Export .glb file',
                                                   dialogtype='SaveFile')
        self.btn_export = mset.UIButton(
            ('Export to Specific Path').center(68, ' '))
        self.chk_savescene = mset.UICheckBox()
        self.chk_savescene.label = ' Save Scene File'
        #### batch mode
        self.batchmode_window = mset.UIWindow(name='', register=False)
        self.batchmode_window.width = 280
        self.batchmode_rollout = mset.UIDrawer('Batch Mode')
        self.batchmode_rollout.containedControl = self.batchmode_window
        self.batchmode_rollout.open = True
        self.batchmode_rollout.setMinor(True)

        self.dialog_batchimport = Mset_showDialog(
            title='Batch import from folder', dialogtype='OpenFolder')
        self.dialog_batchexoprt = Mset_showDialog(
            title='Batch export to folder', dialogtype='OpenFolder')
        self.search_subfolder = mset.UICheckBox()
        self.search_subfolder.label = ' Serach subfolders'
        self.export_subfolder = mset.UICheckBox()
        self.export_subfolder.label = ' Export to External Relate path'
        self.btn_batchexport = mset.UIButton(('Batch Export').center(72, ' '))
        self.chk_savescenes = mset.UICheckBox()
        self.chk_savescenes.label = ' Save Scene File'

        #### settings
        self.setting_window = mset.UIWindow(name='', register=False)
        self.setting_window.width = 280
        self.setting_rollout = mset.UIDrawer('glTF Exporter Setting')
        self.setting_rollout.open = True
        self.setting_rollout.containedControl = self.setting_window

        self.label_setting = mset.UILabel(
            (' glTF Exoprt Quality Setting ').center(52, '-'))
        self.quality = Mset_listBox(title='Texture Quality : ',
                                    items=['Low', 'Medium', 'High', 'Full'])
        self.vertexcolor = mset.UICheckBox()
        self.vertexcolor.label = 'Use Vertex Colors'
        self.matelliclabel = mset.UILabel('Metaliness Threshold : ')
        self.matellic = mset.UISliderFloat()

        ### initoption
        self.matellic.value = 0.8

        self.draw()

        self.controllers()
            material.getSubroutine('transparency').setField(
                'Alpha Map', myTexture)


## create ui class
AssignMaterial = UI_AssignMaterial()
GltfExporter = UI_GltfExporter()
ChangeShaderType = UI_ChangeShaderType()
SceneInfo = UI_SceneInfo()

# Main window
mainWindow = mset.UIWindow('Moonshine TDAL Tools')
mainWindow.width = 305

## add ui to Main window
mainWindow.addReturn()
mainWindow.addElement(AssignMaterial.rollout)
mainWindow.addReturn()
mainWindow.addElement(GltfExporter.rollout)
mainWindow.addReturn()
mainWindow.addElement(ChangeShaderType.rollout)
mainWindow.addReturn()
mainWindow.addElement(SceneInfo.rollout)
mainWindow.addReturn()

closebutton = mset.UIButton(('Close Window').center(76, ' '))
closebutton.onClick = lambda: (mset.shutdownPlugin())
mainWindow.addElement(closebutton)
## showUI
mainWindow.visible = True
Beispiel #8
0
list.title = 'Himesh Set'
list.addItem('FBX')
list.addItem('OBJ')
list.selectedItem = 0  #selected FBX first
rotationlabel = mset.UILabel()
rotationlabel.text = "Rotation:"
rotationX = mset.UITextFieldFloat()
rotationX.width = 35
rotationY = mset.UITextFieldFloat()
rotationY.width = 35
rotationZ = mset.UITextFieldFloat()
rotationZ.width = 35
rotationX.value = -90
rotationY.value = 0
rotationZ.value = 0
closeBottum = mset.UIButton()
closeBottum.text = 'close'
closeBottum.small = True


def closewindow():
    win.close()


closeBottum.onClick = closewindow
finalBottum = mset.UIButton()
finalBottum.text = 'Go!'

#Set GUI
win.addElement(infolabel)
win.addReturn()