Matisse Posted May 27, 2022 Share Posted May 27, 2022 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 Quote Link to comment
Jesse Cogswell Posted May 27, 2022 Share Posted May 27, 2022 Looking at the function reference, it looks like SetObjExpandTexture has been obsolete since VW2009. I have a plug-in that builds different texture parts that still works quite well in 2022, the only thing that my script has that yours doesn't is SetTextureSet set to 0 for object textures. Quote Link to comment
Matisse Posted May 27, 2022 Author Share Posted May 27, 2022 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 Quote Link to comment
Jesse Cogswell Posted May 27, 2022 Share Posted May 27, 2022 @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 Quote Link to comment
Matisse Posted May 28, 2022 Author Share Posted May 28, 2022 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 Quote Link to comment
Recommended Posts
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.