Announcement

Collapse
No announcement yet.

Problem with Scripted Controller and V-Ray motion blur

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with Scripted Controller and V-Ray motion blur

    So I have a scripted controller that is setting the transform for several dozen objects in my scene. These objects move around as expected, and even work as a backburner render. I just enabled V-Ray's camera based Motion Blur, and lo and behold none of the objects controlled by my script have any motion blur, even though all of the other objects in my scene are blurred correctly.

    These objects don't have any animation applied to them (they are just being pushed around by a script), and so I can understand why V-Ray might assume that they are not moving. So, would anyone have any suggestions for how I could get these objects to mo-blur? I could bake this animation to key frames, but I'd prefer to leave it dynamic if possible.

    -Ray
    =======================
    Ray Collett - Design Visualization Specialist
    WSP USA - Visualization and Data Intelligence
    Visualization & Data Intelligence Portfolio (vizportfolio.com)
    =======================

  • #2
    Ok, it may be a shot in the dark, but you might try parenting them to a dummy, and key the dummy twice (in place, or with a very small motion).
    Reading the rayserver doc of the shaders sdk, your problem might arise because they just don't qualify as moving primitives, while if they are parented to a moving object, (or keyframed, not necessarily moving,that's what i hope) they might do, and get sampled as such, giving you the correct moblur.

    Have a go and see if that's the case...

    Lele

    Comment


    • #3
      I checked this under max9 32bit and RC3, and moblur works as expected for both the physcam and a standard cam/persepctive view.
      If you didn't manage to sort this, could you share a scene with the camera and one of those objects?

      Lele

      Comment


      • #4
        To explicitly mark an object as changing, so that V-Ray will sample it multiple times for motion blur, you can assign a Bend modifier to the object and animate only the Direction parameter (no matter how).

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment


        • #5
          So ANY keyframing on the object, its modifiers, and hierarchy would flag it as such?

          Does it matter, at all, if the keys are different, or not?
          Ie. i have to set keys which are different, or simply set two keys which have the same values?

          Thanks for the nice trick, btw.

          Lele

          Comment


          • #6
            So, here's the results of my testing to date:

            I parented the objects that my script is controlling to a box. I animated the position of the box. The objects did motion blur, but they are blurred in the direction that my box is moving, NOT in the direction of each respective object. -- Strike one.

            I applied a bend modifier to my objects and animated the Direction param. No blur. I animated the bend amount, still no blur. I added a noise modifier, animated the phase... no motion blur. Animated modifiers don't seem to be effecting my scene at all. -- Strike two.

            Anything that I parent to these objects also do not motion blur. Anything that I position constraint to these objects do not motion blur. --Strike Three?


            So, here's a file that everyone can play with. The Conductor object has the script on it's scale attribute. It controls the transform of 12 different trailer dummies. The trucks are parented to the dummies, and the train cars are position constrained to the front truck and a lookat aimed at the rear truck. You will see that the motion blur works for the engine at the front of the train because it is linked to the dummy with the path controller. All of the other cars render without moBlur.

            Max8 scene, vRay 1.5 RC2:
            http://www.newlands.cc/temp/MoBlur_S...er_Test_01.rar

            Let me know what tricks you can find to make this render properly.

            Thanks,
            Ray
            =======================
            Ray Collett - Design Visualization Specialist
            WSP USA - Visualization and Data Intelligence
            Visualization & Data Intelligence Portfolio (vizportfolio.com)
            =======================

            Comment


            • #7
              I am getting an error in the script expression when I open your file: "--Type error: Call needs function or class, got: undefined" and it will not evaluate. There is no indication of where the error is, so I'm not sure what needs to be changed to make it work.

              Best regards,
              Vlado
              I only act like I know everything, Rogers.

              Comment


              • #8
                The array called in the function ([4] )isn't declared anywhere visible, much less so populated, so the expression doesn't evaluate.

                still, rendering without closing the maxscript controller window results in this, at frame 91 (notice i exxagerated the moblur effect to cover 3 frames).


                A bit more input would be required, in case...

                Lele

                Comment


                • #9
                  Hmm, seems like one of the functions in my script is not evaluating before it's needed. I need to re-arrange the definition of SQ up to the top of the scripted controller.

                  A quick fix is to execute this in your script listener:

                  fn sq num = (num * num)

                  Or, here is the fixed scene file:

                  http://www.newlands.cc/temp/MoBlur_S...er_Test_02.rar

                  Hope that fixes the script problem.

                  -Ray
                  =======================
                  Ray Collett - Design Visualization Specialist
                  WSP USA - Visualization and Data Intelligence
                  Visualization & Data Intelligence Portfolio (vizportfolio.com)
                  =======================

                  Comment


                  • #10
                    Hi,

                    in cases like this I would always recommend to use the script to set keyframes to a bezier controller. This way you can be sure that it interpolates right between the frames and is consistent for network rendering. Or just collapse the modifier before rendering.

                    Best regards,

                    Dieter
                    --------
                    visit my developer blog

                    Comment


                    • #11
                      Dieter: That may be one possible end solution, but I'd loose a lot of flexibility if I had to bake the keyframes for each of my trains. In some of my animations, I'm going to be controlling upwards of 10 trains, some of them will be very long freight trains. Baking each of those would probably result in a 20+ Megabyte max file. My animators also want a dynamic solution so that they can adjust the animation without having to revert back to pre-collapsed versions, etc.

                      -Ray
                      =======================
                      Ray Collett - Design Visualization Specialist
                      WSP USA - Visualization and Data Intelligence
                      Visualization & Data Intelligence Portfolio (vizportfolio.com)
                      =======================

                      Comment


                      • #12
                        I've still not found a good solution for this. Anyone else come up with a different solution other than baking key frames?

                        Thanks,
                        -Ray
                        =======================
                        Ray Collett - Design Visualization Specialist
                        WSP USA - Visualization and Data Intelligence
                        Visualization & Data Intelligence Portfolio (vizportfolio.com)
                        =======================

                        Comment

                        Working...
                        X