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
    • Recent
    • Tags
    • Users
    • Login

    Initialise global objects for scene [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 244 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

      On 08/11/2014 at 09:21, xxxxxxxx wrote:

      Hi
      I'm trying to figure out something very simple - how with a python tag - to have it create a cube in the scene upon initialisation - so that it persists, and can be accessed globally.  The problem I'm having is that the external renderer is recreating another cube by reinitialising the document.

      This is the example code - how would I change it ?  Thanks..

      import c4d
      #Welcome to the world of Python

      doc.InsertObject(c4d.BaseObject(c4d.Ocube))
      def main() :
          pass

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

        On 08/11/2014 at 09:30, xxxxxxxx wrote:

        A tag is simply not the right tool to get done what you want. Why can't
        you use a Python Generator instead?

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

          On 08/11/2014 at 09:53, xxxxxxxx wrote:

          Yeah I'll try that. Makes sense. Thank you!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post