Jump to content

SetObjExpandTexture


Recommended Posts

I had some PIOs that had parts with the ability to apply different textures.  Worked for many versions but is broken now.  Anyone else run into this and any solutions?

 

result := GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand);

SetObjExpandTexture(objectHand, TRUE);
RemoveCustomTexParts(objectHand);
AddCustomTexPart(objectHand, 100, 'pillow');
AddCustomTexPart(objectHand, 200, 'welt');

 

Above portion of the PIO.

 

m

Link to comment

Jesse, Thanks for the response.  I was looking at SetTextureSet this am and added to the code, but with no effect.  Based on your reply, I tried again and still no go.  Would you be willing to share a little of your code so I can see if there is something else I am missing? 

 

Interesting side note.  The page for SetObjExpandTexture has no reference to it being obsolete, though the Obsolete Function page does confirm you are correct.

 

m

Link to comment

@Matisse Attached is the quick and dirty plug-in that I wrote to help learn texturing in Vectorscript.  I wrote it in VW2019, but just tested it in VW2022 and it seemed to work correctly.  It looks like I used SetTextureSet set to 1 in the test, but changing it to 0 had no appreciable effect, nor did commenting out the line completely.

 

Let me know if you need any help installing the plug-in.  In the Workspace Editor, it will be found in the "Research and Development" category.

Texturing Test.vso

Link to comment

Jesse, thanks so much for uploading your script; I am not sure I could have figured this one without your example.  For anyone else reading, there were two steps in your code that made it work for me:

 

        FOR i:=100 TO 106 DO
            BEGIN
                {SetDefaultTexMapN(h,i,0);}
                SetTextureRefN(h,-1,i,0);
                {SetTexMapIntN(h,i,0,1,0);
                SetTexMapBoolN(h,i,0,7,TRUE);
                SetTexMapBoolN(h,i,0,3,TRUE);
                SetTexMapBoolN(h,i,0,4,TRUE);}
            END;

 

 

In this step where you are "touching" the texture map in some way, for some reason this is the trick to populate the part menu in the texture tab.  For it to work, looks like just one SetTex*** is required.

 

The second item was checking IsNewCustomObject.  This step allows the modification of the texture selection, mapping and anything else:

 

IF(IsNewCustomObject(objectName)=TRUE) THEN BEGIN
RemoveCustomTexParts(objectHand);
AddCustomTexPart(objectHand, 1000, 'pillow');
AddCustomTexPart(objectHand, 2000, 'welt');
SetDefaultTexMapN(objectHand,1000,0);
SetDefaultTexMapN(objectHand,2000,0);
END;

 

Thanks again,

 

m

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...