THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/10/2011 at 09:59, xxxxxxxx wrote:
Hi there,
I'm attempting to port some existing Delaunay Triangulation code over to work in Cinema 4d. I'd like to preface this with that I'm not an experienced C4d user, and I'm doing this as part of a collab project with a friend. However I've many years of programming experience in a professional setting so I'm guessing my issue will be more on the C4d side of things.
I've basically setup a scene with a plane which has a single textureTag on it, which points to a material with a single colour shader on it. The texture for the colour shader is a bitmap. I am running the following code in a python generator to grab the plane and attempt to pull the bitmap off of it. However I'm getting None back for the bitmap.
Code
import c4d
import inspect
from c4d import utilsdef main() :
doc = c4d.documents.GetActiveDocument()
vidPlane = doc.SearchObject('vidPlane')
print vidPlane
textureTag = vidPlane.GetTag(c4d.Ttexture)
print textureTag
material = textureTag.GetMaterial()
print material
colShader = material[c4d.MATERIAL_COLOR_SHADER]
print colShader
colBitmap = colShader.GetBitmap()colBitmap == None
print colBitmap
Output
<c4d.BaseObject object called 'vidPlane/Plane' with ID 5168 at 0x000000000DFB41F0>
<c4d.TextureTag object called 'Texture/Texture' with ID 5616 at 0x000000000DFB41B0>
<c4d.BaseMaterial object called 'videoMaterial/Mat' with ID 5703 at 0x000000000DFB41D0>
<c4d.BaseShader object called 'Bitmap/Bitmap' with ID 5833 at 0x0000000012A3EAA8>
None
Usually at this point I'd check out the documentation, however it appears the documentation is rather lacking. On a side note if anyone knows where the source of this c4d namespace is would be incredibly handy) Is there anything obviously wrong with what I'm doing here?
I'm running in R13.