コード例 #1
0
 def __init__(self, title='Rollout', contained=None, rolloutOpen=True):
     self.window = mset.UIWindow(name='', register=False)
     self.rollout = mset.UIDrawer()
     self.rollout.title = title
     self.rollout.open = rolloutOpen
     if contained:
         self.rollout.containedControl = contained
     else:
         self.rollout.containedControl = self.window
コード例 #2
0
    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()
コード例 #3
0
    def __init__(self, mapList=['item1', 'item2']):
        self.window = mset.UIWindow(name='', register=False)
        self.window.width = 280
        self.rollout = mset.UIDrawer()
        self.rollout.title = 'Assign Material'
        self.rollout.open = True
        self.rollout.containedControl = self.window
        self.affixlist = Mset_listBox(title='Filename Suffix : ',
                                      items=['Suffix', 'Infix', 'Prefix'])
        self.extlist = Mset_listBox(title='file ext : ',
                                    items=global_TextureFormatItems)
        self.mapListDict = {}
        self.mapList = mapList

        self.draw()
        self.controllers()
コード例 #4
0
    def __init__(self):
        self.window = mset.UIWindow(name='', register=False)
        self.rollout = mset.UIDrawer('Set All Material Shader Type')
        self.rollout.open = False
        self.rollout.containedControl = self.window
        self.surface_shader = Mset_listBox(title='Surface : ',
                                           items=global_SurfaceShaderItems)
        self.microsurface_shader = Mset_listBox(
            title='Microsurface : ', items=global_MicrosurfaceShaderItems)
        self.albedo_shader = Mset_listBox(title='Albedo : ',
                                          items=global_AlbedoShaderItems)
        self.diffuse_shader = Mset_listBox(title='Diffusion : ',
                                           items=global_DiffusionShaderItems)
        self.reflectivity_shader = Mset_listBox(
            title='Reflectivity : ', items=global_ReflectivityShaderItems)
        self.reflection_shader = Mset_listBox(
            title='Reflection : ', items=global_ReflectionShaderItems)
        self.secondaryreflection_shader = Mset_listBox(
            title='Secondary Reflection : ',
            items=global_SecondaryReflectionShaderItems)
        self.occlusion_shader = Mset_listBox(title='Occlusion : ',
                                             items=global_OcclusionShaderItems)
        self.emissive_shader = Mset_listBox(title='Emmisive : ',
                                            items=global_EmissiveShaderItems)
        self.transparency_shader = Mset_listBox(
            title='Transparency : ', items=global_TransparencyShaderItems)
        self.extra_shader = Mset_listBox(title='Extra : ',
                                         items=global_ExtraShaderItems)

        ### initoption
        self.surface_shader.listBox.selectedItem = 1
        self.microsurface_shader.listBox.selectedItem = 1
        self.albedo_shader.listBox.selectedItem = 1
        self.diffuse_shader.listBox.selectedItem = 2
        self.reflectivity_shader.listBox.selectedItem = 4
        self.reflection_shader.listBox.selectedItem = 0
        self.secondaryreflection_shader.listBox.selectedItem = 0
        self.occlusion_shader.listBox.selectedItem = 0
        self.emissive_shader.listBox.selectedItem = 0
        self.transparency_shader.listBox.selectedItem = 2
        self.extra_shader.listBox.selectedItem = 0

        self.draw()

        self.controllers()
コード例 #5
0
    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()
コード例 #6
0
import os
import mset
from importer.unity_project import cache as UPROJECT
from utils import marmoset_materials_utils as MMU

global u_mats
u_mats = []

window = mset.UIWindow("Import Unity Materials")
window.width = 400
window.height = 800

drawer = mset.UIDrawer(name="Settings")
drawer_window = mset.UIWindow(name="", register=False)
drawer.containedControl = drawer_window

scrollbox = mset.UIScrollBox()
scrollbox_window = mset.UIWindow(name="", register=False)
scrollbox.containedControl = scrollbox_window

global checks_list
checks_list = []


def sunc_scene_materials():
    for mat in mset.getAllMaterials():
        for check in checks_list:
            if mat.name == check.label:
                check.value = True

コード例 #7
0
        matid = matid + 1


#Json Support
def show_json_data():
    data_loc = open((material_dir + "zdata.json")).read()
    mat_data = json.loads(data_loc)
    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()
コード例 #8
0
    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()