Justin Smith Posted May 23, 2014 Share Posted May 23, 2014 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. Quote Link to comment
Justin Smith Posted May 31, 2014 Author Share Posted May 31, 2014 So it definitely appears that I need to be using a bitmap texture with vs.SetTextureBitmap(shaderRecord, textureBitmap): What I need to figure out is if its possible to go from a bitmap image to a bitmap texture. Some of the paintnode Functions perhaps? Quote Link to comment
Justin Smith Posted June 9, 2014 Author Share Posted June 9, 2014 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. Quote Link to comment
Justin Smith Posted December 26, 2014 Author Share Posted December 26, 2014 (edited) 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 December 26, 2014 by Justin Smith Quote Link to comment
Carles Olle Posted December 8, 2016 Share Posted December 8, 2016 Hi @Justin Smith, did you ever figure out how this is supposed to work? Thanks --Carlos 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.