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

    Log in annotation tag (python)

    General Talk
    4
    10
    1.2k
    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.
    • ROMANR
      ROMAN
      last edited by ROMAN

      Hello for everyone! Anybody know how to send changes of project in annotation tag?

      What i mean when i talk about "changes". For example, you change position of light, color of material, position of object and so on.

      As i understand i should convert changes in text and send it in tag, but i haven't got idea how to realise it.

      The main idea of script:

      1. Pressing on the render button
      2. Null appears. It has the same name with render and it has an Annotation tag.
        The Annotation tag contains all changes in project.
      3. If you press the render button after that you wil have new null with new changes

      It's a kind of memorization of log...

      1 Reply Last reply Reply Quote 0
      • CairynC
        Cairyn
        last edited by

        ...and where would you get those changes from? Logging all activity in a scene? Or comparing the scene with a "previous" scene that you get from somewhere? Or analyzing the Undo stack? (Not sure whether that is even possible, and all undos are lost when you close the scene anyway.)

        This is far from trivial.

        My best approach would be to store the last scene state somewhere and then do a full comparison of all objects with the current state of the scene, including all parameters of interest. Which can be a lot; I wouldn't even be sure that an annotation tag can contain all changes that you do (e.g. moving points in a polygon object).

        1 Reply Last reply Reply Quote 1
        • ROMANR
          ROMAN
          last edited by

          "...and where would you get those changes from?" That why i asked about it. Why is it mostly hardcore ideas that come to my mind...

          Cairyn, thanks a lot for your answer!

          1 Reply Last reply Reply Quote 0
          • CairynC
            Cairyn
            last edited by

            As far as I know, C4D does not have an internal log of actions, so there is no easy way to access the activity history. Logging it directly would involve capturing the whole internal messaging, I don't think this is feasible.

            If you're just looking for certain changes, then the comparison method is probably easiest (you can use the object's internal IDs to find out whether the hierarchy changed), as you only need to look for a predefined set of parameter changes. Although this requires storing the comparison scenes somewhere, so you need to have some agreement on how the directories on disk are supposed to be organized.

            As a quick estimation, this would be a five-digit $/€ project (I'm not offering), but on the other hand you could start it slow with a small parameter set and then expand it over time.

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

              hi,

              I moved this topic to General Programming and discussions. As @Cairyn said, I'm not sure it's doable and for sure, it's a lot of work to do something like this.
              We don't know if you are looking for somebody to implement such a tool or if you want to do it yourself. If you want to implement it yourself, you need to come with more direct question that we can answer. This idea is probably too wide and blurry for us to guide you.

              Cheers,
              Manuel

              MAXON SDK Specialist

              MAXON Registered Developer

              ROMANR 1 Reply Last reply Reply Quote 0
              • ROMANR
                ROMAN @Manuel
                last edited by ROMAN

                @m_magalhaes i want to write it by myself.

                @Cairyn offer next way "My best approach would be to store the last scene state somewhere and then do a full comparison of all objects with the current state of the scene, including all parameters of interest."

                To my mind it's a great variant.
                But i haven't got any idea how to do it. I don't want to make a log for all changes it will be enough if i could do it for important parameteres of object.

                CairynC 1 Reply Last reply Reply Quote 0
                • CairynC
                  Cairyn @ROMAN
                  last edited by

                  @roman It is important that to recognize a change, you will need both the previous state and the current state. I recommended just storing the full scene in the previous state because then you are guaranteed to have all data available.

                  Of course, you may say "a full scene is too much, I just want to remember the previous state of the logged data snippets", but then you will still need to store these somewhere, and you'd end up with needing a file format of your own to store them to disk.

                  (You can store the old state in the scene by defining your own data set with all store/load functions, but good grief, what an effort! 😉 )

                  You will not escape the necessity to "remember in some form" the old states when you press your button. Losing that information means you don't have anything to compare against. Unless you want to monitor the full system, but I really don't think that is feasible.


                  Let me question something... do you really need to log the CHANGES? What you want is to store the "important parameters" of certain objects, which - looking at it realistically - will be a very small subset of all the data. (Havng a log that tells you e.g. that point 4837 in object xyz has been moved from position (0, 5.991, 7.634) to position (0.772, 5.991, 7.634) is going to be so large and overwhelming that it becomes utterly useless.)

                  Why don't you just put ALL the CURRENT data for these objects into the tag? So the annotation would say "the camera is x; the color of the flower is blue; the background is mybgr.hdri". No comparison, just the current data that you are using for this render.

                  It boils down to a deeper question: What is your usecase? How do you expect to use that data later on? Which data would be most useful in that situation?

                  ROMANR 1 Reply Last reply Reply Quote 0
                  • ROMANR
                    ROMAN @Cairyn
                    last edited by ROMAN

                    Yes! Cairyn you are right! That's what i want to do. I want to remember the state of the object at a current render.

                    @cairyn said in Log in annotation tag (python):

                    Why don't you just put ALL the CURRENT data for these objects into the tag? So the annotation would say "the camera is x; the color of the flower is blue; the background is mybgr.hdri". No comparison, just the current data that you are using for this render.

                    CairynC 1 Reply Last reply Reply Quote 0
                    • CairynC
                      Cairyn @ROMAN
                      last edited by

                      @roman Well, that is much easier. Then you only need to extract the values of the parameters from the objects in question, put them into text form, and store them in the tag. Python is fairly string-friendly so this is not too difficult.

                      You just need to define the objects and parameters, and then research a way how to identify them (SearchObject, SearchMaterial, ...). For the extraction of the parameter IDs, you can use drag&drop into the Console, but I guess you know that already.

                      1 Reply Last reply Reply Quote 0
                      • ferdinandF
                        ferdinand
                        last edited by

                        Hello @ROMAN,

                        without any further questions or replies, we will consider this topic as solved by Monday and flag it accordingly.

                        Thank you for your understanding,
                        Ferdinand

                        MAXON SDK Specialist
                        developers.maxon.net

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