What is a c4d python octane command to convert c4d native Bitmap into Octane ImageTexture? Or what way we can do instead creating Bitmap shader containing texture and injecting it into material, create ImageTexture node if material is OctaneMaterial and connect it into correct link inside Octane Node Editor?
C4D default python example that creates Bitmap link:
- Code: Select all
# Create a new bitmap shader and set its filename to the texture path
shader = c4d.BaseList2D(c4d.Xbitmap)
shader[c4d.BITMAPSHADER_FILENAME] = texture_path
# Insert the shader into the document
doc.InsertShader(shader)
# Set the shader as the link for c4d.OCT_MATERIAL_DIFFUSE_LINK
mat[c4d.OCT_MATERIAL_DIFFUSE_LINK] = shader
# Print the name of the selected texture
print(f"Selected diffuse texture: {file_name}")