Fit Subcomponent UVs To Image


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.

8 thoughts on “Fit Subcomponent UVs To Image

      • //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]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s