Announcement

Collapse
No announcement yet.

use appsdk to render multiple frames in a scene

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

  • use appsdk to render multiple frames in a scene

    Is it possible to render multiple frames in a scene? I tried api such as renderView.get_transform(), but only one transform returned.


    It can be done with vray standlone, the scene is as following:

    RenderView renderView {
    transform=interpolate(
    (0, Transform(Matrix(Vector(0.8371752, -0.54693484, 0.0), Vector(2.0281938E-8, 3.1044898E-8, 1.0), Vector(-0.5469348, -0.83717513, 3.7082913E-), Vector(-7201.6455, -11023.323, 4.8828125E-4))),
    (1, Transform(Matrix(Vector(0.9194308, -0.39325187, 0.0), Vector(1.4582926E-8, 3.4095176E-8, 1.0), Vector(-0.39325187, -0.9194308, 3.7082916E-), Vector(-5178.0586, -12106.405, 4.8828125E-4)))
    );
    fov=1.5968513;
    focalDistance=3000.0;
    clipping=0;
    clipping_near=0.0;
    clipping_far=100000.0;
    use_scene_offset=0;
    }

    SettingsOutput output_settings {
    img_width=800;
    img_height=450;
    frames_per_second=1;
    frames=ListInt(
    0,1);
    }


  • #2
    From api doc, there is no way to get interpolate transforms from RenderView::get_transform().

    Transform VRay::Plugins::RenderView::get_transform()const
    Camera transform - position and rotation [UI Guides] gpuSupport=full [Default value] Transform(Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)), Vector(0, 0, 0))

    Comment


    • #3

      Hi,

      V-Ray AppSDK is fully capable of rendering multiple frames as well as setting and getting their corresponding property values at different times/frames.

      1. Reading animated values:

      Use VRayRenderer::setCurrentTime() or alternatively setCurrentFrame(). The later requires correctly set SettingsOutput plugin.

      Reading a Plugin property value e.g. renderView.get_transform() will return the value at the time set by one of the above functions. The value may be interpolated between adjacent times.

      std::vector<double> Plugin::getKeyframeTimes(propertyName) will return a vector of keyframe times if the property is animated or an empty one if it's not. You can loop through them and read their values if needed.

      3. Setting animated values:

      AppSDK makes a difference between animated and non-animated property values. So:

      Tell the renderer you want to set animated values by calling VRayRenderer.useAnimatedValues(true). Otherwise every time you set a new value it will overwrite the previous one.

      Call VRayRenderer::setCurrentTime(time0) (or alternatively setCurrentFrame(frame0)).
      Set the plugin property value e.g. renderView.set_transform(transform0).

      Call VRayRenderer::setCurrentTime(time1) (or alternatively setCurrentFrame(frame1)).
      Set the plugin property value e.g. renderView.set_transform(transform1).

      Repeat as many times as needed.

      4. Rendering a specific frame:

      Call setCurrentFrame() (or alternatively setCurrentTime()). Render the frame with VRayRenderer::start() or startSync().

      5. Rendering an animation sequence:

      Use VRayRenderer::renderSequence() instead of VRayRenderer::start()

      Check the samples in appsdk/Examples/cpp/animation folder.

      Hope this helps.

      Best,
      Stan

      Comment

      Working...
      X