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

    python plugins ObjectData how can use the doc ?

    Scheduled Pinned Locked Moved SDK Help
    7 Posts 0 Posters 603 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 03/01/2011 at 02:05, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12 
      Platform:   Windows  ;   
      Language(s) :       PYTHON  ;

      ---------
      Hi everyone this my first post i try use in plugins.ObjectData i want take the doc becuase i want take the time frame in this example  `` i know this dosen't work correct ``class MyMain(plugins.ObjectData) :
       def GetVirtualObjects(self, op, hh) :
         **doc=documents.GetActiveDocument()** # <- maybe need change this ? Time=doc.GetTime() Frame=Time.GetFrame(doc.GetFps()) print Frame if Frame==0:return c4d.Ocube ``   if Frame==10:return c4d.Ocone
      `   if Frame==20:r:return c4d.OSphere
      return None

      the problem is here ``doc=documents.GetActiveDocument() dosen't work correct in render
        i think i need something like this to use **ObjectData. AddToExecution( _self_ , _op_ , _list_ ) ObjectData.Execute`( self , op , doc , bt , priority , flags )**
      here i have doc 🙂

      but i don't know how to use this

      any idea ?

      Thank you

      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 03/01/2011 at 04:05, xxxxxxxx wrote:

        Hi and Welcome to PluginCafe.com. Please try this:

        doc=op.GetDocument()

        Cheers, Sebastian

        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 03/01/2011 at 04:28, xxxxxxxx wrote:

          Thank you Very Much Sebastian now understand what i did wrong
          doc=op.GetDocument()  ->  so this Returns the document where the object is stored in .
          and work fine now  !

          Thank you again !!!!

          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 03/01/2011 at 04:38, xxxxxxxx wrote:

            Just want to add that GetActiveDocument returns only the opened editable document. The renderer, except viewport rendering, uses a clone of this document. This is why GetActiveDocument will return the wrong document during rendering.

            cheers,
            Matthias

            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 03/01/2011 at 05:03, xxxxxxxx wrote:

              Hi just i want to ask something i found now
              whe i use

              doc1=documents.GetActiveDocument()
                doc2=op.GetDocument()
                print doc1.GetFps()
                print doc2.GetFps()

              the doc1 work fine but if i use doc2 like op.GetDocument() say error

              i do something wrong ?
              i use in

              def Init(self, op) :
               because i want to install my vaules and one is c4d.BaseTime

              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 03/01/2011 at 15:52, xxxxxxxx wrote:

                In Init(..) the object is not in the document yet.

                obj=c4d.BaseObject(YOUR_PLUGIN_ID) #internal call of the constructor and Init(..) afterwards
                doc.InsertObject(obj) #here op is connected with the doc
                
                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 04/01/2011 at 01:55, xxxxxxxx wrote:

                  ok thank you very much for clear this 😉

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