Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Python constants?

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 547 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

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

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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_>_

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                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()   
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post