Hello!
I want to load a file into the Quick Loader via python but I can't find any way to do it.
Because I have not found a way to use it I tried doing it like this:
> Import model
> Create Baker
> Create BakeGroup
!=> Failed to reparent the model parts into the BakeGroups.
So, by chance, if the Quick Loader is unable in python; can I reparent objects somehow?
Replies
import mset baker = mset.BakerObject() # Use Quick Loader baker.importModel("E:/MyModel.fbx")<pre>mset.importModel</pre>, call<pre>addGroup</pre>to relevant groups, and assign the<pre>parent</pre>of the imported meshes to the<pre>"Low"</pre>or<pre>"High"</pre>objects of that group.import mset # Create a new BakerObject baker = mset.BakerObject() # Import model myMesh = mset.importModel("E:/MyMesh.fbx") # Traverse myMesh and find objects I want to be "High" or "Low" bakerDict = {} def traverseMesh(o): if isinstance(o, mset.MeshObject): if "_low" in o.name: key = o.name.replace("_low", "").lower() if key in bakerDict: bakerDict[key]["low"] = o else: bakerDict[key] = {"low": o, "high": None} if "_high" in o.name: key = o.name.replace("_high", "").lower() if key in bakerDict: bakerDict[key]["high"] = o else: bakerDict[key] = {"low": None, "high": o} for obj in o.getChildren(): traverseMesh(obj) # Traverse the imported mesh file traverseMesh(myMesh) # Convert bakerDict to baker scene hierarchy for key in bakerDict.keys(): if bakerDict[key]["low"] != None and bakerDict[key]["high"] != None: curGroup = None for child in baker.getChildren(): if key in child.name.lower(): curGroup = child if curGroup == None: curGroup = baker.addGroup(key) for gc in curGroup.getChildren(): if gc.name == "Low": bakerDict[key]["low"].parent = gc if gc.name == "High": bakerDict[key]["high"].parent = gc # Done adding model, now we can bake baker.bake()Is there a way to have a group in Maya with an arbitrary amount of meshes all with either the suffix _low or _high and have marmoset create baking groups with those suffixes in the correct locations? (all _low under the low baking group and all _high in the high baking group)
Maya
Marmoset
Also how would someone create an import button?
fbx_file = "C:/Users/zanthresun/Desktop/asd.fbx"
baker = mset.BakerObject()
baker.importModel(fbx_file)