Jump to content
Developer Wiki and Function Reference Links ×

SetTextureBitmap


Recommended Posts

Any one have any luck with this function?

def vs.SetTextureBitmap(shaderRecord, textureBitmap):

return None

I'm trying to pass a bitmap image (ObjectId 14) into the function. Doesn't seem to be working. Do I need to be using a bitmap texture?

What I'm trying to do is take a Bitmap Image object and make it into a texture with an image shader. I make the texture fine, I can add the shader record. Just can't seem to add a bitmap to the texture. Specifically want to add a bitmap that is already in the document but not setup as a render works texture.

Link to comment
  • 2 weeks later...

Anyone know how CreatePaintFromImage or CreatePaintFromImgN are supposed to work?

I've tried passing both an image (14) and a TextureDefinitionMaterial (97) and get back a nil obj.

I'm also not exactly sure what a "paint node" is.

"Return Value

Returns the handle to the newly created paint node."

My hope was that it would take a bitmap image and convert it to a texture bitmap.

Link to comment
  • 6 months later...

Still would love some insight here. The workflow I'm trying to accomplish is loading up images from disk automatically (based on a worksheet) and then creating a renderworks texture out of them.

So far I can only figure out how to import the images as an image and can't convert them to a textureBitmap.

Here's code (partially taken from a VW sample plugin). How or what could I do to instead of insert a image below insert a bitmapTexture?

def getImageForFileName(fileName, err, dirPath):

#uses FSActLayer so I think I need to deselect

vs.DSelectAll()

major, minor, maintenance, platform = vs.GetVersion()

isMac = False

if platform == 1: isMac = True

# define a location to import the images

importPt = (0,0)

if err == 0: # no-error

hsfDirPath = dirPath

if isMac: ok, hsfDirPath = vs.ConvertPosix2HSFPath( dirPath )

fileIndex = 1

fileName += ".png"

name, ext = os.path.splitext( fileName )

if ext.lower() == '.png':

imagePath = os.path.join( dirPath, fileName )

vs.ImportImageFile( imagePath, importPt )

hImage = vs.FSActLayer()

if hImage == 0:

vs.AlrtDialog("No image with name '", fileName, "' in directory " , dirPath)

return hImage

Edited by Justin Smith
Link to comment
  • 1 year later...

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...