Carles Olle Posted October 26, 2016 Share Posted October 26, 2016 Hi, I'm trying to change the size of the bitmap associated to a particular shader record in a texture. I'm not sure how to do that but I assume that I can do it through some code like this: shaderRecord = vs.GetShaderRecord(texture, 1) bitmapHandle = vs.GetTextureBitmap(shaderRecord) # Get bitmap width and height pixels paintWidth = vs.GetObjectVariableLongInt(bitmapHandle, 530) paintHeight = vs.GetObjectVariableLongInt(bitmapHandle, 531) # Set the bitmap feature to max wdith vs.SetTexBFeatureStart(bitmapHandle, 0, 0) vs.SetTexBFeatureEnd(bitmapHandle, piantWidth, 0) # Set the width feature to the corresponding real world dimension vs.SetTexBitFeatureSize(bitmapHandle, vs.PImage_Width) # Set the bitmap feature to max height vs.SetTexBFeatureEnd(bitmapHandle, 0, piantHeight) # Set the width feature to the corresponding real world dimension vs.SetTexBitFeatureSize(bitmapHandle, vs.PImage_Height) The problem is that bitmapHandle doesn't seem to work for most of these calls. Specifically GetObjectVariableLongInt returns 0 in both cases. I'm sure it is something obvious but I cannot find where is the problem. Helps would be appreciated. Cheers --Carlos Quote Link to comment
Pat Stanford Posted October 26, 2016 Share Posted October 26, 2016 It is likely that the PaintWidth and PaintHeight refer to some other object than the Bitmap you have the handle to. Have you tried getting them directly from the Shader instead of the bitmap? I was fighting a similar problem trying to get the record and field of a piece of linked text. Worked great once I found the right object. I will be happy to take a closer look, but please upload a file with the texture/shader already in it and preferably a larger chunk of code so I don't end up solving problems you already have. Quote Link to comment
Carles Olle Posted October 27, 2016 Author Share Posted October 27, 2016 Hi Pat, Thanks for replying. Yes, I've tried using the shader record but it does not seem to help either. Please fins attached the files with the source code. It is a tool plug-in so you will need install it and enable it in your workspace. --Carlos Picture.zip Quote Link to comment
Pat Stanford Posted October 27, 2016 Share Posted October 27, 2016 What version of VW are you using? Quote Link to comment
Carles Olle Posted October 27, 2016 Author Share Posted October 27, 2016 VW2017 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.