Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    1. Maxon Developers Forum
    2. nicholas_yue
    N
    • Profile
    • Following 0
    • Followers 0
    • Topics 14
    • Posts 22
    • Best 2
    • Controversial 0
    • Groups 0

    nicholas_yue

    @nicholas_yue

    2
    Reputation
    21
    Profile views
    22
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    nicholas_yue Unfollow Follow

    Best posts made by nicholas_yue

    • RE: Post import - Updating alembic path does not update scene ?

      @m_magalhaes Is there a way to get Cinema4D to update the object identifier ? When I import an alembic file, Cinema4D builds a hierarchy and all the paths recursively. Is there a way to tell Cinema4D to rebuild that hierarchy or is deleting and re-importing the only way to get the object identifier rebuilt ?

      posted in Cinema 4D SDK
      N
      nicholas_yue
    • Keeping text and edit UI component horizontally

      Hi,

      I have difficulty keeping the label for a edit UI component on the same line with the following code. I want the FRAME_CHUNK_EDIT to the right of FRAME_CHUNK_LABEL

          def CreateLayout(self) :
              '''
              Frame Chunk size,
              Render folder prefix
              Frame range (start, end)
              '''
              self.GroupBegin(id=1013, flags=c4d.BFH_SCALEFIT, cols=1)
              #
              self.GroupBegin(id=1014, flags=c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, cols=1)
              self.AddStaticText(FRAME_CHUNK_LABEL, c4d.BFV_MASK, name="Frame Chunk size")
              self.AddEditNumberArrows(FRAME_CHUNK_EDIT, c4d.BFV_MASK, initw=100)
              self.GroupEnd()
              #
              self.AddButton(SUBMIT_BUTTON, c4d.BFV_MASK, initw=100, name="Submit")
              self.GroupEnd()
              return True
      

      Cheers

      posted in Cinema 4D SDK
      N
      nicholas_yue

    Latest posts made by nicholas_yue

    • Finding name/handle to last object merged into scene

      After calling MergeDocument()

      merge_status = c4d.documents.MergeDocument(doc, path,
                                                 c4d.SCENEFILTER_MERGESCENE | c4d.SCENEFILTER_OBJECTS)
      

      I check merge_status to be true and wish to find some handle/name to the object associated with the call to MergeDocument(), how do I do that ?

      I tried the following on an empty scene

              doc = c4d.documents.GetActiveDocument()
              ao = doc.GetActiveObject()
      

      that works if I am calling MergeDocument for a single path but if I am calling MergeDocument (in a loop) for a collection of paths, GetActiveObject() points to the same object, not the next one corresponding to the next path I am merging into the scene

      Cheers

      posted in Cinema 4D SDK
      N
      nicholas_yue
    • C4DUnhandledExceptionFilter - debugging log ?

      I am troubleshooting a crash in C4D R21 commandline.exe on Windows 10

      Error: application crashed
      C4DUnhandledExceptionFilter: writing exception info
      C4DUnhandledExceptionFilter: writing call stacks
      

      Where are the likely place I can go to look at the exception info and call stacks that was being written out ?

      Cheers

      posted in Cinema 4D SDK
      N
      nicholas_yue
    • Object GetNext() method does not advance to next object

      We are using Arnold with C4D

      While iterating the scene, we have found that one of the node (create via the ArnoldtoC4D plugin), the GetNext() method does not return the next object but itself, this resulted in an infinite loop iterating the scene.

      Since we are now sitting between two different vendors, I am trying to narrow it down to who I need to follow up with regarding this issue.

      
      >>> doc = c4d.documents.GetActiveDocument()
      >>> obj = doc.GetFirstObject()
      >>> print(obj)
      <c4d.BaseObject object called 'Arnold distant_light/Arnold Light' with ID 1030424 at 0x0000027ACD423D10>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423AD0>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423FB0>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423DF0>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423AD0>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423FB0>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423DF0>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423AD0>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423FB0>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423DF0>
      >>> obj.GetNext()
      <c4d.BaseObject object called '<display driver>/Arnold Driver' with ID 1030141 at 0x0000027ACD423AD0>
      >>> 
      

      Cheers

      posted in Cinema 4D SDK
      N
      nicholas_yue
    • RE: Dialog button hangs C4D

      @zipit There was a typo when updating to use the new IDs generated from Maxon, it has since been resolved and the plugins are loading.

      Cheers

      posted in Cinema 4D SDK
      N
      nicholas_yue
    • Alternative way to iterate list other than GetNext()?

      I am currently using this approach to iterate the objects in a document

      doc = c4d.documents.GetActiveDocument()
      obj = doc.GetFirstObject()
      next_obj = obj.GetNext()
      while next_obj:
      # Do stuff
      next_obj = obj.GetNext()

      Is there some equivalent of doing this via e.g. indexing in a for-loop ?

      Cheers

      posted in Cinema 4D SDK
      N
      nicholas_yue
    • RE: Dialog button hangs C4D

      I have generated the IDs from the site you recommended.

      When I replace the plugin IDs with those generated from https://developers.maxon.net/forum/pid the menu would not even load.

      Cheers

      posted in Cinema 4D SDK
      N
      nicholas_yue
    • Dialog button hangs C4D

      I have a dialog button which hangs when I click it but it only hangs for a specific scene.

      From looking at the printout in the python console window, it appears that when I click the 'Submit' button, it never reaches the call to Command()

      TTR_PLUGIN_ID = 999121032
      TTR_CANCEL_BUTTON = 12003
      TTR_SUBMIT_BUTTON = 12004
      
          def Command(self, id, msg):
              print('TurnTableRenderDialog::Command()')
              print('id = {}'.format(id))
              print('TTR_SUBMIT_BUTTON = {}'.format(TTR_SUBMIT_BUTTON))
              if (id == TTR_SUBMIT_BUTTON):
                  print('TTR_SUBMIT_BUTTON')
      
          def CreateLayout(self):
              '''
              Frame Chunk size,
              Render folder prefix
              Frame range (start, end)
              '''
              self.SetTitle('Submit turn table to Tractor (PlutoWithDamage)')
              self.GroupBegin(id=1013, flags=c4d.BFH_SCALEFIT, cols=1)
              #
              self.GroupBegin(id=1014, flags=c4d.BFH_SCALEFIT, cols=2)
      
              self.AddStaticText(TTR_COMMENT_LABEL, c4d.BFV_MASK |
                                 c4d.BFH_RIGHT, name="Comments")
              self.AddEditText(TTR_COMMENT_EDIT, c4d.BFV_MASK |
                               c4d.BFH_LEFT, initw=400)
      
              self.AddStaticText(TTR_FRAME_RANGE_LABEL, c4d.BFV_MASK |
                                 c4d.BFH_RIGHT, name="Frame range (start,end,step)")
              self.GroupBegin(id=1015, flags=c4d.BFH_SCALEFIT, cols=3)
              self.AddEditNumberArrows(TTR_FRAME_RANGE_START, c4d.BFV_MASK, initw=100)
              self.AddEditNumberArrows(TTR_FRAME_RANGE_END, c4d.BFV_MASK, initw=100)
              self.AddEditNumberArrows(TTR_FRAME_RANGE_STEP, c4d.BFV_MASK, initw=100)
              self.GroupEnd()
      
              self.GroupEnd()
              #
              self.GroupBegin(id=1016, flags=c4d.BFV_MASK | c4d.BFH_RIGHT, cols=2)
              self.AddButton(TTR_CANCEL_BUTTON, c4d.BFV_MASK |
                             c4d.BFH_RIGHT, initw=100, name="Cancel")
              self.AddButton(TTR_SUBMIT_BUTTON, c4d.BFV_MASK |
                             c4d.BFH_RIGHT, initw=100, name="Submit")
              self.GroupEnd()
      
      posted in Cinema 4D SDK python
      N
      nicholas_yue
    • Rendering with specific camera ?

      I am writing some scene assembly tool using C4D and c4dpy.

      I am bringing in Alembic cameras and other geometry assets.

      On the commandline.exe, there is no option to specify which camera I can render with so I am wondering if there is some python call I need to make to the C4D document before saving so that when I render the file, it knows which camera to use ?

      Cheers

      posted in General Talk python
      N
      nicholas_yue
    • Detecting unsaved changes

      Hi,

      Is there a call to c4d to ascertain if there are unsaved changes in the current session. The current session was started from opening a file from disk.

      I am using R21 on Windows and using Python.

      Cheers

      posted in Cinema 4D SDK
      N
      nicholas_yue
    • Getting and setting frame range from RenderData

      Hi,

      I read that I can get the RenderData object via

      rdata = doc.GetActiveRenderData()

      I see that frame range values are documented here

      https://developers.maxon.net/docs/py/2023_2/modules/c4d.documents/RenderData/index.html?highlight=renderdata

      RDATA_FRAMEFROM
      RDATA_FRAMETO
      RDATA_FRAMESTEP

      Cheers

      posted in Cinema 4D SDK
      N
      nicholas_yue