I have this mel script that do that thing, just convert this to python
code, I am just lazy now to convert it... :D sorry :D
proc string strip( string $object )
{
string $buffer[];
tokenize $object "." $buffer;
return $buffer[0];
}
global proc getFileAttribute()
{
//know what is selected.
string $obj[] = `ls -l -sl`;
//find the size of selection.
int $objSize = size($obj);
//if it is more than one...
if ($objSize > 1)
{
confirmDialog -t "Object Select"
-message "Please select only one object."
-messageAlign "center"
-button "OK"
-defaultButton "OK";
return;
}
//if it is less than one...
else if ($objSize < 1)
{
confirmDialog -t "Object Select"
-message "Please select one object."
-messageAlign "center"
-button "OK"
-defaultButton "OK";
return;
}
//select the shapeNode.
string $objShape[] = `pickWalk -direction "down" $obj`;
//know what shading engine is connected.
string $connection[] = `listConnections -d true -source false
-p false -type "shadingEngine" $objShape`;
print $connection;
//strip the ".outColor" from the result of the material
string $sgList[] = `listSets -type 1 -ets -o $objShape`;
string $materialList = strip( `connectionInfo -sfd ($sgList[0] +
".surfaceShader")`);
print $materialList;
string $texture = "";
string $class[] = getClassification( `nodeType $materialList` );
if ( "shader/surface" == $class[0] && `connectionInfo -id
( $material + ".color" )` )
{
$texture = strip( `connectionInfo -sfd ( $material +
".color" )` );
}
return $texture;
}
On Mar 18, 2:50 pm, "[email protected]"
<[email protected]> wrote:
> Does anyone know the name of the command or the way that I can get the
> full path of the textures from a selected object?
>
> Thanks,
> -m
--
http://groups.google.com/group/python_inside_maya