Python constants?



  • 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()



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    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.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 29/08/2012 at 09:42, xxxxxxxx wrote:

    You can also download the ultimate python c4d documentation (May 17, 2012).



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    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).

    Where can I find it.
    Google did not help.

    Thanks.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    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.

    Material Types

    MCgFX Private.
    Mbanji Banji.
    Mbanzi Banzi.
    Mbase Base material.
    Mcheen Cheen.
    Mdanel Danel.
    Mfog Fog.
    Mmabel Mabel.
    Mmaterial Standard material.
    Mnukei Nukei.
    Mplugin Plugin material - pass the plugin ID.
    Mterrain Terrain.

    _<_t_>_



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    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()   
    

Log in to reply