dhughes3 Posted August 30, 2021 Share Posted August 30, 2021 Hi, I'm trying to write a script which updates the texture mapping offsets using SetTexMapReal but am having a little trouble... After running the script the OIP correctly shows the new offsets but when you view the object the texture hasn't moved to reflect the new values. Any idea what I am doing wrong? Thanks, Duncan Quote Link to comment
Vectorworks, Inc Employee klinzey Posted August 30, 2021 Vectorworks, Inc Employee Share Posted August 30, 2021 Try resetting for forcing the object to redraw after you update the texture map. Quote Link to comment
dhughes3 Posted August 30, 2021 Author Share Posted August 30, 2021 21 minutes ago, klinzey said: Try resetting for forcing the object to redraw after you update the texture map. Thanks for the suggestion -Any tips on how? I tried the Redraw & RedrawAll commands but the texture still didnt update. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted August 30, 2021 Vectorworks, Inc Employee Share Posted August 30, 2021 Try ResetOject() Quote Link to comment
dhughes3 Posted August 30, 2021 Author Share Posted August 30, 2021 13 minutes ago, klinzey said: Try ResetOject() Nope. didnt work. Maybe I'm doing something wrong in my code... Procedure SetMapping; Procedure SetOffset(h :HANDLE); BEGIN SetTexMapReal(h,3,1,300); ResetObject(h); End; Begin ForEachObject(SetOffset,(Sel=True)); End; Run (SetMapping); Quote Link to comment
BillW Posted August 24 Share Posted August 24 Has anyone found a way to update texture mapping settings. Tried all of above to no avail. Alternatively is there a way to invoke the "Update" button on the "Render" tab. Looks like "ExtrudeAlongPath" call sets Mapping type to "Perimeter" which has now changed (at VW 2022) to "Surface UV" when using "Extrude Along Path" menu command. I am thinking of using "auto align plane" and "follow longest edge" set using SetTexMapIntN(fsactlayer,3,0,1,0); {Plane} SetTexMapBoolN(fsactlayer,3,0,7,True); {auto align} SetTexMapBoolN(fsactlayer,3,0,5,True); {long edge} but have no way to invoke update. I note GetTexMapIntN(fsactlayer,3,0,1) returns 0 for both "Plane" and "Auto Align Plane" options. It would be nice if we could have an updated "ExtrudeAlongPath" call to handle all the options available in the "Extrude Along Path" menu command. I know we can use (from Marionette) eap = vs.CreateCustomObjectPath('Extrude Along Path', path, profile) vs.SetObjectVariableBoolean(eap, 1167, True) vs.SetRField(eap, 'Extrude Along Path', 'Fix Profile', 'No') but had problems in the past using this method. Quote Link to comment
SamIWas Posted August 31 Share Posted August 31 This is something I have been dealing with as well. I have a script which runs through a series of objects and offsets the X and Y of the texture to more randomize multiple identical objects with the same texture. But, they do not update unless I move the objects. Quote Link to comment
BillW Posted September 2 Share Posted September 2 Thanks for reminding me. Just a note for others, for event enabled plugins, presumably the plugin option "Reset on Move" will need to be set. I haven't tried but I wonder if "PrepRelatedObjectForChange" might work but I doubt it. Generally, I have never successfully used this call (amongst a few other calls) Quote Link to comment
Mirko Guhr Posted September 16 Share Posted September 16 Good day @SamIWas and @BillW, unfortunately, i don’t have a script on hand that quickly changes the textures of objects so i can test it. I would appreciate it if you could provide a test file for me. Recently, i was able to automatically update a Marionette with ResetObject (see post). I can’t say if this also applies to a texture changed by the script. There was also a post where the author updated with python the normal faces with ReDraw after making changes. Maybe this will help you a bit further. Quote Link to comment
Vectorworks, Inc Employee Dave Donley Posted September 16 Vectorworks, Inc Employee Share Posted September 16 I wanted to suggest calling ResetObject, this would be necessary to regen the rendering once you have updated texture values. 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.