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

    Set MINTIME and MAXTIME with a New Project[SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 383 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 07/10/2015 at 16:53, xxxxxxxx wrote:

      Hi Guys!

      I am trying to get a new project start up with MINTIME and MAXTIME to set at different numbers in the project settings and for a example my plugin S.O.E.
      Example:
          #-----| Documents_U.N.I.T.S_Function |----------------------#
          def UNITS_FUNCTION(self, unit) :

      global fileSeparator

      doc = c4d.documents.GetActiveDocument()
              if doc == None:
                  return False        
              # Set project scale
              unitScale = c4d.UnitScaleData()
              unitScale.SetUnitScale(1.0, unit)

      bc = c4d.BaseContainer()
              bc[c4d.DOCUMENT_DOCUNIT] = unitScale
              doc.SetDocumentData(c4d. DOCUMENTSETTINGS_DOCUMENT, bc)
              return True
          #---------------------------------------------------------------------------#

      ####-F.U.N.C.T.I.O.N.S->>>>########

      #--------------------| M.E.T.E.R.S_(ID_M) |--------------------## 
          #If meters in the Getlong-(ComboBox) is selected then Execute Meters Fromats.
          def DAE_1_4_Format_M(self) :
          
              c4d.CallCommand(100004820, 100004820) # Copy

      c4d.CallCommand(12094, 12094) # New

      c4d.CallCommand(self.UNITS_FUNCTION(c4d.DOCUMENT_UNIT_M)) # <<----call out for Documents U.N.I.T.S Function

      c4d.CallCommand(100004821, 100004821) # Paste

      c4d.CallCommand(60000, 5) # Export Filter for DAE 1.4 in R16 and r17
              #This how I to close a DOCUMENT with out asking. 
              doc = c4d.documents.GetActiveDocument()
              if doc == None:
                  return False  
              c4d.documents.KillDocument(doc)

      So now i am trying this:

      bc = c4d.BaseContainer()        
      fps = doc[ c4d.DOCUMENT_FPS ] = 30
      minTime = doc[ c4d.DOCUMENT_MINTIME ].SetNumerator( 40 )
      maxTime = doc[ c4d.DOCUMENT_MAXTIME ].SetNumerator( 78 )
      doc.SetDocumentData(c4d. DOCUMENTSETTINGS_DOCUMENT, bc)

      It dont work!

      Feel free to share your ideas or tips,
      Cheers,
      Ashton

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

        On 08/10/2015 at 01:57, xxxxxxxx wrote:

        Hello,

        to change the document settings you have to actually assign a new value to the parameter and not just edit the returned value. Something like this:

          
        doc[c4d.DOCUMENT_MINTIME] = c4d.BaseTime(10, 30)  
        

        best wishes,
        Sebastian

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

          On 08/10/2015 at 08:43, xxxxxxxx wrote:

          It works and thanks man. But the next thing is how can fix this i want to Copy the object that is in side the linkbox plz.

          self.lnk_source = self.AddCustomGui(UI_LNK_SOURCE, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT, 50, 10, self.rootLinkBaseContainer)

          if id == Verify_fbxBT:
                      #gui.MessageDialog("This feature is Still IN Development!", c4d.GEMB_OK)
                      doc = c4d.documents.GetActiveDocument()
                      fps = doc.GetFps()
          #------------------------------------------------------------------
          #how i fix this! get it to Copy what is in thelink box
                      self.lnk_source.GetLink()
                      doc.GetActiveObjects(UI_LNK_SOURCE)
              
          #------------------------------------------------------------------
                      c4d.CallCommand(12094, 12094) # New
                      doc = c4d.documents.GetActiveDocument()
                      unitScale = c4d.UnitScaleData()
                      unitScale.SetUnitScale(1.0,c4d.DOCUMENT_UNIT_M)
                      bc = c4d.BaseContainer()
                      bc[c4d.DOCUMENT_DOCUNIT] = unitScale
                      doc[c4d.DOCUMENT_MINTIME] = c4d.BaseTime(self.GetLong(UI_FRAME_FROM), 30)
                      doc[ c4d.DOCUMENT_MAXTIME] = c4d.BaseTime(self.GetLong(UI_FRAME_TO), 30)
                      doc.SetDocumentData(c4d. DOCUMENTSETTINGS_DOCUMENT, bc)
                      c4d.CallCommand(100004821, 100004821) # Paste

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

            On 08/10/2015 at 09:07, xxxxxxxx wrote:

            Hello,

            for questions no longer related to the thread's original topic please open a new thread. Thanks.

            Best wishes,
            Sebastian

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