Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. nicholas_yue
    N
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    nicholas_yue

    @nicholas_yue

    2
    Reputation
    20
    Posts
    13
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    nicholas_yue Follow

    Posts made by 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 Development
      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 Development
      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 Development
      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://plugincafe.maxon.net/c4dpluginid_cp the menu would not even load.

      Cheers

      posted in Cinema 4D Development
      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 Development
      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 Programming & Plugin Discussions
      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 Development
      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/Cinema4DPythonSDK/html/modules/c4d.documents/RenderData/index.html?highlight=renderdata

      RDATA_FRAMEFROM
      RDATA_FRAMETO
      RDATA_FRAMESTEP

      Cheers

      posted in Cinema 4D Development
      N
      nicholas_yue
    • Directory UI component ?

      Hi,

      I am reading the following

      https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.gui/GeDialog/index.html?highlight=addeditnumberarrows#GeDialog.AddEditText

      hoping there might be some directory browsing UI.

      My intention is to allow the user to pick an output directory for some processing.

      Cheers

      posted in Cinema 4D Development
      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 Development
      N
      nicholas_yue