|04 April 2014||#1|
Join Date: Apr 2006
Bodypaint and Python
I wan to fill "Freeze 3D View" layer with bitmap from hdd.
I don't think it's possible to control "Freeze 3D View" dialog with python but at least I want to automate process of filling it with bitmap selected through explorer window.
I have some problems with c4d.modules.bodypaint.PaintLayerBmp classes.
When I feed ImportFromBaseBitmap() with bitmap object it gives me this error
"TypeError: descriptor 'ImportFromBaseBitmap' requires a 'c4d.modules.bodypaint.PaintLayerBmp' object but received a 'c4d.bitmaps.BaseBitmap'"
In SDK it's clearly written that this function requires BaseBitmap object.
I'm pretty sure I'm doing something fundamentally wrong.
|04 April 2014||#2|
This line is rentableportfolio
Join Date: Nov 2005
The error message is correct. You didn't create an instance of PaintLayerBitmap. Instead you passed a bitmap object to the function as first argument (for self).
So, the correct version would be
Quote: pl = bodypaint.PaintLayerBmp()
Quote: pl = bodypaint.PaintLayerBmp
The problem is, PaintLayerBmp cannot be instantiated. Instead you might get an object from somewhere - e.g: from PaintTexture.GetFirstLayer, ... What exactly do you want to do?
Hope this helps.
|04 April 2014||#3|
Join Date: Feb 2005
I can use all of the bodypaint functions in the C++ SDK without any problems.
But not a single one in the python SDK works for me.
Here's a C++ example of using ImportFromBaseBitmap() to fill the current image in the TV window with a different bitmap image
I can't even do something as simple as grabbing the current image it the TV window because it's telling me I need to have params in my functions. But the docs say the params are void.
And when I try to use help() on them. I get this (...). What the heck does dot,dot,dot mean?
I just assumed all of this weirdness meant that bodypaint wasn't wrapped into Python yet.
But if it is wrapped. Then the current documentation is basically useless. And needs to be updated with some basic examples.
|04 April 2014||#4|
Join Date: Apr 2006
Thank you guys for help.
I'm just trying to automate process of projection painting on some geometry through over two hundred cameras generated by photogrammetry software.
All those cameras names are matching with photos names so I made a little python generator to display photo on a background object corresponding with active cameras name.
This has greatly improved modeling workflow.
SDK has some nasty holes in it and for someone like me who just want to scratch only a surface of python scripting to be able to automate workflow it is hard sometimes to figure stuff out.
I was able to create something that works quite well.
This one just pastes an image you choose from disk to BP texture window, and no, "CLIPBOARDOWNER_PICTUREVIEWER" is not my mistake.
It appears that "CLIPBOARDOWNER_BODYPAINT" works only for picture viewer and the other one just for bodypaint.
BTW. Is there any chance to fill newly created layer mask with solid black color automatically?
|reply share thread|