Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/08/2012 at 06:08, xxxxxxxx wrote:
Sorry for this basic question. Where can I find the python contacts and possible imports. E.g. I'm looking for the Mbase constant to create a material. Python can not find this one. Looking for it, using the console I can see it is 5703, but I rather use the constant.
Here the code for creating a material:
def main() :
mymat = c4d.BaseMaterial(5703) mymat[c4d.ID_BASELIST_NAME] = "my material" doc.InsertMaterial(mymat) c4d.EventAdd()
On 29/08/2012 at 09:18, xxxxxxxx wrote:
Look for the file /MAXON/CINEMA 4D Rnn/resource/coffeesymbols.h - that's where you will find many, but not all of these constants (including Mbase). Exactly the place you'd think to look, of course.
BTW, Mbase is 5702, Mmaterial is 5703.
On 29/08/2012 at 09:42, xxxxxxxx wrote:
You can also download the ultimate python c4d documentation (May 17, 2012).
On 29/08/2012 at 11:49, xxxxxxxx wrote:
Originally posted by xxxxxxxx You can also download the ultimate python c4d documentation (May 17, 2012).
Originally posted by xxxxxxxx
Where can I find it. Google did not help.
Thanks.
On 29/08/2012 at 11:56, xxxxxxxx wrote:
Originally posted by xxxxxxxx Look for the file /MAXON/CINEMA 4D Rnn/resource/coffeesymbols.h - that's where you will find many, but not all of these constants (including Mbase). Exactly the place you'd think to look, of course. BTW, Mbase is 5702, Mmaterial is 5703.
Thanks, I'll have a look.
You are correct Mbase is 5702, Mmaterial is 5703. Creating a material with Mbase 5702 wil not work.
However, I do not quite understand what Mbase stands for. Mbase = Base material? Mmaterial = Standard material
Below is copied from the python documentation.
_<_t_>_
On 29/08/2012 at 12:09, xxxxxxxx wrote:
Here is an example of script for create a new material with red in the color's channel:
import c4d def main() : new_mat = c4d.BaseMaterial(c4d.Mmaterial) new_mat[c4d.MATERIAL_COLOR_COLOR]=c4d.Vector(1,0,0) doc.InsertMaterial(new_mat) c4d.EventAdd() if __name__=='__main__': main()