예제 #1
0
        public static MDagPath CombineMeshesUsingMEL(List <MDagPath> list, string resultName = null, bool keepHistory = true, MergeUVSetMethod mergeUVSetMethod = MergeUVSetMethod.ByName)
        {
            List <string> dagNames = new List <string>();

            foreach (MDagPath dag in list)
            {
                dagNames.Add(dag.fullPathName);
            }
            return(CombineMeshesUsingMEL(dagNames, resultName, keepHistory, mergeUVSetMethod));
        }
예제 #2
0
        public static MDagPath CombineMeshesUsingMEL(List <string> dagNames, string resultName = null, bool keepHistory = true, MergeUVSetMethod mergeUVSetMethod = MergeUVSetMethod.ByName)
        {
            if (dagNames == null || dagNames.Count == 0)
            {
                return(null);
            }
            CmdStrConstructor cc = new CmdStrConstructor("polyUnite");

            //polyUnite -ch 1 -mergeUVSets 1 -centerPivot -name resultName pCube2 pCube1
            cc.UpdateParm("ch", keepHistory);
            cc.UpdateParm("mergeUVSets", 1);
            cc.UpdateToggle("centerPivot", true);
            cc.UpdateParm("name", resultName);
            cc.UpdateTargets(dagNames);
            resultName = MGlobal.executeCommandStringResult(cc.ToString(), true);
            //Debug.Log("resultName:" + resultName);
            return(null);// BasicFunc.GetDagPathByName(resultName);
        }
예제 #3
0
        public static MDagPath CombineMeshesUsingMEL(MSelectionList list, string resultName = null, bool keepHistory = true, MergeUVSetMethod mergeUVSetMethod = MergeUVSetMethod.ByName)
        {
            if (list == null || list.length == 0)
            {
                return(null);
            }
            List <string> dagNames = new List <string>();

            foreach (MDagPath dag in list.DagPaths())
            {
                dagNames.Add(dag.fullPathName);
            }
            return(CombineMeshesUsingMEL(dagNames, resultName, keepHistory, mergeUVSetMethod));
        }