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

    Motion Blur, ExecutePasses in VideoPostData

    Cinema 4D SDK
    c++ 2025
    2
    2
    71
    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.
    • A
      Aaron
      last edited by ferdinand

      Hi colleagues,
      What's the way to get several steps of motion blur transformation matrices for BaseObjects of the BaseDocument within the single frame that is on the render process of VideoPostData?
      I usually do

      1. ClonedDoc = BaseDoc->GetClone(COPYFLAGS_0, NULL);
      2. Then do execute of passes and collection of matrix positions
        for(time steps) {
        ClonedDoc->SetTime();
        ClonedDoc->ExecutePasses()
        }
      3. Then use matrix positions to calculate motion blur
        The observations tell that GetClone and ExecutePasses are expensive calls.
        Is there any way to get subframe transformation matrices?
        I have seen some get motion data, but it seems to be for Physical render.

      Thanks,
      Aaron


      I think there is a bug in the following situation:

      1. There is a recent featured with object Liquid Mesh in the document of VideoPostData pipeline
      2. When we just collect the scene elements the polygon object cache (POC) returned by Liquid Mesh->GetCache() contains the polygons to build this nice liquid object mesh
      3. When we want to add Motion Blur and call document->ExecutePasses(...) for some time then this POC is flushed and has no polygons or vertices, so it's not collected and can't be rendered
      4. Even if we don't call ExecutePasses() but add Sub-Frame Motion Blur effect in Cinema Settings then POC is also flushed the same way as in #3.

      Bake to Alembic for Liquid Mesh helps but still...

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

        Hello @Aaron,

        Thank you for reaching out to us. Please follow our support procedures.

        • You should consolidate your postings until we answer, i.e., update your last posting instead of creating new ones. I have consolidated your postings for you.
        • You should also spend more time on making your problems reproducible for us. I know it can be easy to overlook in the heat of the battle but your question(s) are not as obvious to me as you probably think they are. As lined out in our support procedures, example code and/or scene data is usually required.

        I cannot answer every possible angle and interpretation this topic of yours could take, but I can state three things which come to mind when reading your two postings.

        What's the way to get several steps of motion blur transformation matrices for BaseObjects of the BaseDocument.

        That is simply not possible. A document has no notion of motion blur as it is a render effects implemented by a render engine, not something documents implement. Cinema's time system BaseTime allows for sub-frame accuracy, e.g., you could set a 10fps document to BaseTime(i, 30) and with that step with three sub-frames through the document. Simple things like position animations or other interpolated values will also work doing this. But simulations might yield different results than stepping with the natural frame rate through the document.

        And the most important thing is that there is absolutely no guarantee that this approach will result in 'matrices', i.e., transforms, that will match with what a render engine produces when you add some kind of sub-frame-based motion blur. Using this BaseTime approach is one way how the render engine could do it, but since render engines always have their own scene format, they could also do the calculation there, yielding different results than what Cinema's animation system would yield.

        When we want to add Motion Blur and call document->ExecutePasses(...) for some time then this POC is flushed and has no polygons or vertices, so it's not collected and can't be rendered

        It is too opaque for me what you are doing there to give a real answer, but:

        • There is no guarantee that the caches of an object are built at any point except for when a render engine gets a scene state to render or inside GetVirtualsObjects when you manually build your dependent objcts. Usually, caches are built but depending on where you are, the cache of another object might not have been built or updated yet, resulting in either an empty cache or you looking at the cache output from the previous scene update.
        • ExecutePasses has become a bit too popular tool recently. I guess that is partially my fault, because I have shown its usage in some examples. But executing the passes on a document is a very expensive operation and should only be carried out when absolutely necessary.
        • I would absolutely not be surprised if something like liquids do not support stepping through a document with a frame rate lower than the documents frame rate. But without concrete data and example code I am just guessing.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

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