Example #1
0
        private void dumpInfo(MObject fileNode, MFnDependencyNode nodeFn, MObjectArray nodePath)
        {
            MObject           fileAttr   = nodeFn.attribute("fileTextureName");
            MPlug             plugToFile = new MPlug(fileNode, fileAttr);
            MFnDependencyNode dgFn       = new MFnDependencyNode();

            MGlobal.displayInfo("Name:    " + nodeFn.name);

            MObject fnameValue = new MObject();

            try
            {
                plugToFile.getValue(fnameValue);
            }
            catch (Exception)
            {
                MGlobal.displayInfo("error getting value from plug");
                return;
            }

            MFnStringData stringFn = new MFnStringData(fnameValue);

            MGlobal.displayInfo("Texture: " + stringFn.stringProperty);

            string path = "Path:    ";

            for (int i = (int)nodePath.length - 1; i >= 0; i--)
            {
                MObject currentNode = nodePath[i];
                dgFn.setObject(currentNode);

                path += dgFn.name + "(" + dgFn.typeName + ")";
                if (i > 0)
                {
                    path += " -> ";
                }
            }
            MGlobal.displayInfo(path);
        }
Example #2
0
		private void dumpInfo(MObject fileNode, MFnDependencyNode nodeFn, MObjectArray nodePath)
		{
			MObject fileAttr = nodeFn.attribute("fileTextureName");
			MPlug plugToFile = new MPlug(fileNode, fileAttr);
			MFnDependencyNode dgFn = new MFnDependencyNode();

			MGlobal.displayInfo("Name:    " + nodeFn.name);

			MObject fnameValue = new MObject();
			try
			{
				plugToFile.getValue(fnameValue);
			}
			catch (Exception)
			{
				MGlobal.displayInfo("error getting value from plug");
				return;
			}

			MFnStringData stringFn = new MFnStringData(fnameValue);
			MGlobal.displayInfo("Texture: " + stringFn.stringProperty);

			string path = "Path:    ";
			for (int i = (int)nodePath.length - 1; i >= 0; i--)
			{
				MObject currentNode = nodePath[i];
				dgFn.setObject(currentNode);

				path += dgFn.name + "(" + dgFn.typeName + ")";
				if (i > 0) path += " -> ";
			}
			MGlobal.displayInfo(path);
		}