AlHanson Posted August 27, 2020 Share Posted August 27, 2020 I'm attempting to retrieve the size of a texture and the 'Get Texture Size' node seems to fit the bill, but I'm not able to figure out what input the node wants. I've tried the Get Texture node with both the string name and the integer id from this but neither seems to be what the vs.GetTextureSize() command in the node wants. The description and web info for this vectorscipt command are lacking. How do you interact with this node, or if not this node, how can i go about getting the size of a texture resource? Quote Link to comment
Pat Stanford Posted August 28, 2020 Share Posted August 28, 2020 Get Texture Size wants a handle to a texture as the input. If you have a texture on an object in the drawing already, use Get Texture Reference to specify the object and part of the object that has the texture you want the size of. You could also use Get Texture to show a drop down list of textures in the file to select one to get the size of. HTH. Quote Link to comment
AlHanson Posted August 28, 2020 Author Share Posted August 28, 2020 Thanks Pat. I'm still confused- what you described is exactly what I was trying and I'm still coming up with a 0 float value on the Texture Size via both the Get Texture Reference and Get Texture nodes. The iTexRef value both nodes provide the index location for the texture (at least I'm assuming that's what this integer value represents?), which presumably should function as the handle here? The texture is currently set for 1" in the resource, so something is not quite right here. I've attached a test file for reference. TextureScaling.vwx Quote Link to comment
Pat Stanford Posted August 28, 2020 Share Posted August 28, 2020 I am not really a Marionette or Python specialist. I am just an old time Vectorscript programmer. I am going to wait and see if any of the Marionette gurus will chime in. Quote Link to comment
AlHanson Posted September 7, 2020 Author Share Posted September 7, 2020 I stumbled on the solution to this! Seems obvious it hindsight, but I didn't think the Name node would work on items in the Resource Library, only items in the drawing. Using the Name node and referencing the texture resource name will produce the handle you need for the Get Texture Size node to work. This is a bit clunky for scripting (at least as I'm trying to use it) but I made one minor tweak to the Get Texture Size node to pull the handle by name and the whole thing works the way it seems like it should now. I've attached a file with the modified node if it's of any use to anybody else. Enjoy! Get Texture Size v2.vwx Quote Link to comment
Elite Exhibits Posted November 18 Share Posted November 18 @AlHanson As a Marionette novice ... What should happen when I Run Marionette Script ? Peter 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.