示例#1
0
        public override bool doRelease(M3dView view)
        {
            // Scale nodes on the selection list.
            // Simple implementation that does not
            // support undo.
            MSelectionList list = new MSelectionList();

            MGlobal.getActiveSelectionList(list);
            MObject node = new MObject();

            for (MItSelectionList iter = new MItSelectionList(list); !iter.isDone; iter.next())
            {
                iter.getDependNode(node);
                MFnTransform xform;
                try
                {
                    xform = new MFnTransform(node);
                }
                catch (System.Exception)
                {
                    continue;
                }

                double[] newScale = new double[3];
                newScale[0] = mousePointGlName.x + 1;
                newScale[1] = mousePointGlName.y + 1;
                newScale[2] = mousePointGlName.z + 1;
                xform.setScale(newScale);
            }
            return(true);
        }
示例#2
0
		public override bool doRelease(M3dView view)
		{
			// Scale nodes on the selection list.
			// Simple implementation that does not
			// support undo.
			MSelectionList list = new MSelectionList();
			MGlobal.getActiveSelectionList(list);
			MObject node = new MObject();
			for (MItSelectionList iter = new MItSelectionList(list); !iter.isDone; iter.next())
			{
				iter.getDependNode(node);
				MFnTransform xform;
				try
				{
					xform = new MFnTransform(node);
				}
				catch (System.Exception)
				{
					continue;
				}

				double[] newScale = new double[3];
				newScale[0] = mousePointGlName.x + 1;
				newScale[1] = mousePointGlName.y + 1;
				newScale[2] = mousePointGlName.z + 1;
				xform.setScale(newScale);
			}
			return true;
		}