def GeneratePlugins(sid, cls): Conform_cid = MaxPlus.Class_ID(0x1ab13757, 0x12365b98) # Known bug for cd in MaxPlus.PluginManager.GetClassList().Classes: if cd.SuperClassId == sid and cd.ClassId != Conform_cid: o = MaxPlus.Factory.CreateAnimatable(sid, cd.ClassId, False) if o: r = cls._CastFrom(o) if r: yield r
def main(): time = MaxPlus.Animation.GetTime() now = MaxPlus.Core.GetCurrentTime() triObjectID = MaxPlus.Class_ID(0x0009, 0) for node in MaxPlus.SelectionManager.Nodes: obj = node.EvalWorldState(time).Getobj() print "obj", obj if (obj.CanConvertToType(triObjectID)): mesh = MaxPlus.TriObject._CastFrom(obj.ConvertToType(triObjectID, time)).GetMesh() if mesh.GetNumVertices() > 0: writeODMesh(mesh) else: print "No Vertices Found, will only work on MeshObjects"
def glmVRayGolaemPostCreationCallback(proxyName): # get node node = MaxPlus.INode.GetINodeByName(proxyName) defaultMatName = node.BaseObject.ParameterBlock.default_material.GetValue() if not defaultMatName: defaultMatName = "crowdProxyDefaultShader" # create VRayMtl (used as default) mat = MaxPlus.Factory.CreateMaterial( MaxPlus.Class_ID(0x37bf3f2f, 0x7034695c)) mat.Diffuse = MaxPlus.Color(1, 0.47, 0) mat.SetName(MaxPlus.WStr(defaultMatName + "@")) # create multi material mmat = MaxPlus.Factory.CreateDefaultMultiMtl() mmat.SetName(MaxPlus.WStr(proxyName + "Mtl")) mmat.SetSubMtl(0, mat) # apply multi material to node node.Material = mmat print("VRayGolaem: " + proxyName + "Mtl MultiMaterial has been successfully assigned to " + proxyName)
for each in selected_nodes: each.Delete() #move nodes for each in selected_nodes: # each.Move(MaxPlus.Point3(25,222,22)) each.Position(MaxPlus.Point3(0,0,0)) #add modifier for each in selected_nodes: mod = MaxPlus.Factory.CreateObjectModifier(MaxPlus.Class_ID(0x9c92c88, 0x13d466dc)) MaxPlus.ModifierPanel.AddToSelection(mod) # Ejemplo de seleccion de tabnodes propios selected_nodes = (MaxPlus.SelectionManager.GetNodes()) myList = MaxPlus.INodeTab() for i in range( 0, len(selected_nodes)): myList.Append(selected_nodes[1]) # print str(selected_nodes[i].GetName())
# :coding: utf-8 # :copyright: Copyright (c) 2016 ftrack import MaxPlus FTRACK_ASSET_HELPER_CLASS_ID = MaxPlus.Class_ID(0x5c8d275e, 0x677d591c)