private bool GetDayNightCycle(IINode node) { string mxs = String.Empty; mxs = $"(maxOps.getNodeByHandle {node.Handle}).ActivationMode"; IFPValue mxsRetVal = Loader.Global.FPValue.Create(); ScriptsUtilities.ExecuteMAXScriptScript(mxs, true, mxsRetVal); bool r = mxsRetVal.I == 1; return(r); }
private float GetFlashPhase(IINode node) { string mxs = String.Empty; mxs = $"(maxOps.getNodeByHandle {node.Handle}).FlashPhase"; IFPValue mxsRetVal = Loader.Global.FPValue.Create(); ScriptsUtilities.ExecuteMAXScriptScript(mxs, true, mxsRetVal); var r = mxsRetVal.F; return(r); }
private bool GetHasSimmetry(IINode node) { string mxs = String.Empty; mxs = $"(maxOps.getNodeByHandle {node.Handle}).HasSimmetry"; IFPValue mxsRetVal = Loader.Global.FPValue.Create(); ScriptsUtilities.ExecuteMAXScriptScript(mxs, true, mxsRetVal); var r = mxsRetVal.B; return(r); }
private float[] GetColor(IINode node) { string mxs = String.Empty; mxs = $"(maxOps.getNodeByHandle {node.Handle}).Color"; IFPValue mxsRetVal = Loader.Global.FPValue.Create(); ScriptsUtilities.ExecuteMAXScriptScript(mxs, true, mxsRetVal); var r = mxsRetVal.Clr.ToArray(); return(r); }
public static bool GetGizmoParameterBoolean(IINode node, string gizmoClass, string paramName, bool IsSubClass = true) { string mxs = String.Empty; if (!IsSubClass) { mxs = $"(maxOps.getNodeByHandle {node.Handle}).{paramName}"; } else { mxs = $"(maxOps.getNodeByHandle {node.Handle}).{gizmoClass}.{paramName}"; } IFPValue mxsRetVal = Loader.Global.FPValue.Create(); ScriptsUtilities.ExecuteMAXScriptScript(mxs, true, mxsRetVal); var r = mxsRetVal.B; return(r); }
public void BakeAnimationsFrame(IINode node, BakeAnimationType bakeAnimationType) { if (bakeAnimationType == BakeAnimationType.DoNotBakeAnimation) { return; } IINode hierachyRoot = (node != null) ? node : Loader.Core.RootNode; #if MAX2020 || MAX2021 || MAX2022 var tobake = Loader.Global.INodeTab.Create(); #else var tobake = Loader.Global.NodeTab.Create(); #endif if (bakeAnimationType == BakeAnimationType.BakeSelective) { foreach (IINode iNode in hierachyRoot.NodeTree()) { if (iNode.IsMarkedAsObjectToBakeAnimation()) { tobake.AppendNode(iNode, false, 0); } } } if (!hierachyRoot.IsRootNode) { tobake.AppendNode(hierachyRoot, false, 0); } Loader.Core.SelectNodeTab(tobake, true, false); if (bakeAnimationType == BakeAnimationType.BakeAllAnimations) { foreach (IINode n in tobake.ToIEnumerable()) { n.SetUserPropBool("babylonjs_BakeAnimation", true); } } ScriptsUtilities.ExecuteMaxScriptCommand(@" sel = selection selNodeNames = for s in sel collect s.name temps = #() for objn in selNodeNames do ( obj = getNodeByName objn tag = getUserProp obj ""babylonjs_BakeAnimation"" if tag != true then continue tmp = undefined tmp = Point() tmp.name = obj.name append temps tmp --store anim to a point for t = animationRange.start to animationRange.end do ( with animate on at time t tmp.transform = obj.transform ) ) i = 1 for objn in selNodeNames do ( obj = getNodeByName objn tag = getUserProp obj ""babylonjs_BakeAnimation"" if tag != true then continue --remove constraint on original object if classOf(obj.transform.controller) == IKControl do ( refdep = refs.dependents(obj.transform.controller) for rd in refdep do ( if classOf(rd) == IK_Chain_Object do ( delete rd ) ) ) obj.transform.controller = Link_Constraint() obj.transform.controller = prs() obj.transform = temps[i].transform --copy back anim from point for t = animationRange.start to animationRange.end do ( with animate on at time t obj.transform = temps[i].transform ) i += 1 ) for t in temps do ( delete t ) "); }