def __init__(self, title='List', items=['item1', 'item2']): self.window = mset.UIWindow(name='', register=False) self.window.width = 280 self.listBox = mset.UIListBox(title) self.items = items self.draw()
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
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, title='label', titlesize=120, info='info', infosize=120): self.window = mset.UIWindow(name='', register=False) self.window.width = 280 self.label = mset.UILabel(title + ' : ') self.label.fixedWidth = titlesize self.info = mset.UILabel(info) self.info.fixedWidth = infosize self.draw()
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()
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()
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()
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()
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
#mat.setSubroutine("reflectivity","Specular") mat.getSubroutine("reflectivity").setField("Metalness Map", mset.Texture(img_specular)) 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
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()
if os.path.isfile(map1): myTexture = mset.Texture(path=map1) myTexture.sRGB = False myTexture.useMipmaps = True 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())
import mset, os, re defaultLowPolyPath = 'D:\\bake\\low\\' defaultHighPolyPath = 'D:\\bake\\high\\' win = mset.UIWindow() win.title = 'EGC_Bake_AutoGroup' infolabel = mset.UILabel() infolabel.text = 'Hipoly name: *_hi.FBX(OBJ)\tLowpoly name: *.FBX' hilabel = mset.UILabel() hilabel.text = "HiPoly folder:" hifolder = mset.UITextField() hifolder.value = defaultHighPolyPath lowlabel = mset.UILabel() lowlabel.text = "LowPoly folder:" lowfolder = mset.UITextField() lowfolder.value = defaultLowPolyPath list = mset.UIListBox() 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