Jayme McColgan Posted July 13, 2021 Share Posted July 13, 2021 (edited) hey guys, so I'm having some trouble assigning a texture to a 3d polygon thats being created in a PIO... ive got color working using vs.SetFillBack but i can't figure out what to use to apply a texture to the surface... ANWSER: ### Tiles wide = 5 tall = 6 ### Tile PHY Size ledsize = 24 ### Texture Name ledtext = "Texture-1" ### Build Extrudged Rectangle vs.BeginXtrd(0, 1) vs.RectangleN (0, 0, 1, 0, (wide*ledsize), (tall*ledsize) ) vs.EndXtrd() ### Assign Texture to extrude last = vs.LNewObj() vs.SetTextureRefN(last, ledtext, 4, 0) Edited August 10, 2021 by Jayme McColgan Figured out an anwser Quote Link to comment
Hans-Olav Posted July 13, 2021 Share Posted July 13, 2021 Hi @Jayme McColgan You can drag a texture from the resource browser onto the 3d polygon or use the rendering tab in the object info palette to assign textures. A more powerful way is to assign texture to classes and choose the right class for your object. https://app-help.vectorworks.net/2021/eng/index.htm#t=VW2021_Guide%2FTextures%2FConcept_Applying_textures_by_class.htm&rhsearch=class textures&rhhlterm=class textures&rhsyns= Quote Link to comment
Sloader Posted July 15, 2021 Share Posted July 15, 2021 Is this what you are looking for? https://developer.vectorworks.net/index.php/VS:SetObjMaterialHandle FUNCTION SetObjMaterialHandle( VAR objectHandle :HANDLE; materialHandle :HANDLE) : BOOLEAN; Quote Link to comment
Jesse Cogswell Posted July 19, 2021 Share Posted July 19, 2021 @Jayme McColgan The script you are looking for is ApplyCustomTexPart. Texturing through Vectorscript/Python is a bit obtuse, but can be pretty powerful as you can add custom texture parts (so you can texture your 3D poly inside of the PIO separately from the rest of the object, and even give it a unique name such as "video screen"). Basically, you define the parts, then use ApplyCustomTextPart to apply the texture of that part using vs.ApplyCustomTexPart(<handle to PIO>,<handle to destination object>,<part ID #>), then select the Part in the Render tab of the OIP. I have not been able to successfully get the texture to a place where the Attribute Mapping Tool will allow you to click and drag the texture around, but the standard Scale, Offset H, Offset V, and Rotation fields of the Render tab of the OIP work as expected. I've attached a Vectorscript example that I used to teach myself texturing through script (I use Vectorscript rather than Python, but you should be able to follow along with what the code is doing). Let me know if you have any trouble installing the plug-in or if you have any questions about it. Texturing Test.vso 1 Quote Link to comment
Jayme McColgan Posted July 24, 2021 Author Share Posted July 24, 2021 On 7/15/2021 at 3:45 AM, Sloader said: Is this what you are looking for? https://developer.vectorworks.net/index.php/VS:SetObjMaterialHandle FUNCTION SetObjMaterialHandle( VAR objectHandle :HANDLE; materialHandle :HANDLE) : BOOLEAN; this seems to only be in 2021 version.... still rocking 2020. Quote Link to comment
Jayme McColgan Posted August 2, 2021 Author Share Posted August 2, 2021 Heres how i achieved it running VW2020 ### Tiles wide = 5 tall = 6 ### Tile PHY Size ledsize = 24 ### Texture Name ledtext = "Texture-2" vs.BeginXtrd(0, 1) vs.RectangleN (0, 0, 1, 0, (wide*ledsize), (tall*ledsize) ) vs.EndXtrd() last = vs.LNewObj() vs.SetTextureRefN(last, ledtext, 4, 0) 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.