Beispiel #1
0
        public static MDagPath AddParentCircle(MDagPath targetDagPath, bool createParallelGrp)
        {
            string   ctlName    = "ctl_" + targetDagPath.partialPathName;
            MDagPath ctlDagPath = BasicFunc.CreateCircle(ctlName);

            ctlName = ctlDagPath.fullPathName;
            MFnTransform targetTrans = new MFnTransform(targetDagPath);

            if (createParallelGrp)
            {
                MFnTransform parellelGrpTrans = new MFnTransform(AddEmptyGroup(new MFnTransform(targetTrans.parent(0))));
                parellelGrpTrans.setTranslation(targetTrans.getTranslation(MSpace.Space.kTransform), MSpace.Space.kTransform);
                //Debug.Log("finalLocalPos:"+BasicFunc.ToCMDSParamStr(parellelGrpTrans.getTranslation(MSpace.kTransform)));
                MEulerRotation rot = new MEulerRotation();
                targetTrans.getRotation(rot);
                parellelGrpTrans.setRotation(rot);
                SetTransformParent(ctlName, parellelGrpTrans.fullPathName);
            }

            MFnTransform circleTransform = new MFnTransform(ctlDagPath);

            circleTransform.setTranslation(new MVector(0, 0, 0), MSpace.Space.kTransform);
            circleTransform.setRotation(new MEulerRotation(0, 90 / ConstantValue.DPR, 0));
            FreezeTransform(circleTransform);
            return(ctlDagPath);
        }
Beispiel #2
0
        public static MDagPath AddChildCircle(MDagPath targetDagPath)
        {
            string   ctlName    = "ctl_" + targetDagPath.partialPathName;
            MDagPath ctlDagPath = BasicFunc.CreateCircle(ctlName);

            ctlName = ctlDagPath.fullPathName;
            SetTransformParent(ctlName, targetDagPath.fullPathName);
            MFnTransform circleTransform = new MFnTransform(ctlDagPath);

            circleTransform.setTranslation(new MVector(0, 0, 0), MSpace.Space.kObject);
            circleTransform.setRotation(new MEulerRotation(0, 90 / ConstantValue.DPR, 0));
            FreezeTransform(circleTransform);
            return(ctlDagPath);
        }