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

    Post import - Updating alembic path does not update scene ?

    Cinema 4D SDK
    2
    7
    1.7k
    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.
    • N
      nicholas_yue
      last edited by

      In our workflow, there are situations where we might need to update the path of the alembic file in the scene downstream.

      I did some experimentation (manually via a C4D interactive session) with that but found that after updating the file path, there is no update to the scene. Is there something else I need to do to get C4D to re-read the alembic file content ?

      Cheers

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi,

        I can't really reproduce the issue here (or i don't understand it)

        something like this is working. Using either the bracket or the SetParameter function is working.

        import c4d
        from c4d import gui
        # Welcome to the world of Python
        
        
        # Main function
        def main():
            filePath  =  "C:\\bendcube.abc"
            alembicPath = "/Cube/Cube_1/CubeShape"
            
            op[c4d.ALEMBIC_PATH] = filePath
            op[c4d.ALEMBIC_IDENTIFIER] =  alembicPath
            c4d.EventAdd()
            
            print "using setparameter"
            filePathID = c4d.DescID(c4d.ALEMBIC_PATH)
            
            alembicID = c4d.DescID ( c4d.ALEMBIC_IDENTIFIER)
            op.SetParameter(filePathID, filePath, c4d.DESCFLAGS_SET_USERINTERACTION )
            op.SetParameter(alembicID, alembicPath, c4d.DESCFLAGS_SET_USERINTERACTION )
            c4d.EventAdd()
        # Execute main()
        if __name__=='__main__':
            main()
        

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        N 1 Reply Last reply Reply Quote 0
        • N
          nicholas_yue @Manuel
          last edited by

          @m_magalhaes I was attempting to change the path to the alembic file in the UI of Cinema4d to understand how C4D handles alembic file before diving into python script, yes, eventually, the path swap will also be done via scripting. Is changing the path to the alembic file all that is required or do I have to click some other button to get C4D to rebuild the hierachy in C4D ? I am changing the path to the alembic file that was already loaded in C4D

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            hi,

            you have to change the filepath and the object identifier. (the path inside the alembic file)

            Cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            N 1 Reply Last reply Reply Quote 0
            • N
              nicholas_yue @Manuel
              last edited by

              @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 ?

              1 Reply Last reply Reply Quote 1
              • ManuelM
                Manuel
                last edited by

                hi,

                well the alembic files can contain multiple objects sot there's no way for Cinema 4D to know witch one you want.
                If your alembic file have an entire hierarchy, your only option is to remove the actual alembic object and re-import a new one.
                That should build the new hierarchy for all the content of your alembic file

                Cheers,
                Manuel

                MAXON SDK Specialist

                MAXON Registered Developer

                1 Reply Last reply Reply Quote 0
                • ManuelM
                  Manuel
                  last edited by

                  hi,

                  I'll set this thread to solved without further feedback 🙂

                  Cheers,
                  Manuel

                  MAXON SDK Specialist

                  MAXON Registered Developer

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