Jump to content

change the size of the bitmap associated to a particular shader record in a texture


Recommended Posts

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

 

Link to comment

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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...