When you click Fit Subcomponent UVs to Image in the Texture Projection property editor, you’ll get these ERRORs in the script history:
' ERROR : Object doesn't support this property or method: 'in_uvprops.IsClassOf' - [line 1842 in C:\Program Files\Autodesk\Softimage 2014\Application\DSScripts\Texture.vbs] ' ERROR : - [line 25] ' ERROR : Property Page Script Logic Error ' ERROR : [23] end if ' ERROR : [24] (null) ' ERROR : >[25] FitSubcomponentUVsToImage Pset.InspectedObjects, filtered ' ERROR : [26] End Sub
The fix for this requires that you edit $XSI_HOME\Application\DSScripts\Texture.vbs. You’ll probably need to edit the Permissions on Texture.vbs so that you have Full Control or Modify permissions.
Find line 1842 in Texture.vbs, and then replace the if..else..endif with this:
set coll = CreateObject("XSI.Collection") if in_uvprops.Type = "XSICollection" then set coll = in_uvprops elseif in_uvprops.IsClassOf( siUVPropertyID ) = True then coll.Add in_uvprops end if
The fix I posted on the Softimage mailing list awhile ago was a one-liner that would enable you to use Fit Subcomponent UVs to Image on a single texture projection. This fix will work if you have multiple texture projections in the property editor.
Can you post the JS code ?
I could, but it isn’t useful, except as an example of how VBScript translates to JScript. Is that what you want, an example?
I would appreciate it 🙂
//set coll = CreateObject(“XSI.Collection”)
//if in_uvprops.Type = “XSICollection” then
// set coll = in_uvprops
//elseif in_uvprops.IsClassOf( siUVPropertyID ) = True then
// coll.Add in_uvprops
//end if
// For testing. Assume a sphere with a texture projection…
var in_uvprops = new ActiveXObject( “XSI.Collection” );
var p = Dictionary.GetObject( “sphere.polymsh.cls.Texture_Coordinates_AUTO.Texture_Projection” );
in_uvprops.Add( p );
//var in_uvprops = Dictionary.GetObject( “sphere.polymsh.cls.Texture_Coordinates_AUTO.Texture_Projection1” )
var coll = new ActiveXObject( “XSI.Collection” );
if (in_uvprops.Type == “XSICollection”)
{
coll = in_uvprops;
}
else if ( in_uvprops.IsClassOf( siUVPropertyID ) == True )
{
coll.Add( in_uvprops );
}
[/soucecode]
I believe the adapted VBS script was posted by ActionArt here:
http://www.si-community.com/community/viewtopic.php?p=33527#p33527
Not exactly. The one posted on si-community is my original one-line fix, which doesn’t work if you have multiple texture projections in the PPG (well, it works, but just for the first inspectedobject).
Ah, sorry…
The download on si-community is still good, and all you have to do is extract a file…no editing of files required 🙂