本文整理汇总了C++中bl::RenderSettings::motion_blur_shutter方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderSettings::motion_blur_shutter方法的具体用法?C++ RenderSettings::motion_blur_shutter怎么用?C++ RenderSettings::motion_blur_shutter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bl::RenderSettings
的用法示例。
在下文中一共展示了RenderSettings::motion_blur_shutter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sync_camera
void BlenderSync::sync_camera(BL::Object b_override, int width, int height)
{
BlenderCamera bcam;
blender_camera_init(&bcam, b_scene);
/* pixel aspect */
BL::RenderSettings r = b_scene.render();
bcam.pixelaspect.x = r.pixel_aspect_x();
bcam.pixelaspect.y = r.pixel_aspect_y();
bcam.shuttertime = r.motion_blur_shutter();
/* border */
if(r.use_border()) {
bcam.border.left = r.border_min_x();
bcam.border.right = r.border_max_x();
bcam.border.bottom = r.border_min_y();
bcam.border.top = r.border_max_y();
}
/* camera object */
BL::Object b_ob = b_scene.camera();
if(b_override)
b_ob = b_override;
if(b_ob) {
blender_camera_from_object(&bcam, b_ob);
bcam.matrix = get_transform(b_ob.matrix_world());
}
/* sync */
Camera *cam = scene->camera;
blender_camera_sync(cam, &bcam, width, height);
}
示例2: sync_camera
void BlenderSync::sync_camera(BL::RenderSettings b_render, BL::Object b_override, int width, int height)
{
BlenderCamera bcam;
blender_camera_init(&bcam, b_render);
/* pixel aspect */
bcam.pixelaspect.x = b_render.pixel_aspect_x();
bcam.pixelaspect.y = b_render.pixel_aspect_y();
bcam.shuttertime = b_render.motion_blur_shutter();
/* border */
if(b_render.use_border()) {
bcam.border.left = b_render.border_min_x();
bcam.border.right = b_render.border_max_x();
bcam.border.bottom = b_render.border_min_y();
bcam.border.top = b_render.border_max_y();
}
/* camera object */
BL::Object b_ob = b_scene.camera();
if(b_override)
b_ob = b_override;
if(b_ob) {
BL::Array<float, 16> b_ob_matrix;
blender_camera_from_object(&bcam, b_engine, b_ob);
b_engine.camera_model_matrix(b_ob, b_ob_matrix);
bcam.matrix = get_transform(b_ob_matrix);
}
/* sync */
Camera *cam = scene->camera;
blender_camera_sync(cam, &bcam, width, height);
}
示例3: sync_camera
void BlenderSync::sync_camera(BL::RenderSettings& b_render,
BL::Object& b_override,
int width, int height,
const char *viewname)
{
BlenderCamera bcam;
blender_camera_init(&bcam, b_render);
/* pixel aspect */
bcam.pixelaspect.x = b_render.pixel_aspect_x();
bcam.pixelaspect.y = b_render.pixel_aspect_y();
bcam.shuttertime = b_render.motion_blur_shutter();
BL::CurveMapping b_shutter_curve(b_render.motion_blur_shutter_curve());
curvemapping_to_array(b_shutter_curve, bcam.shutter_curve, RAMP_TABLE_SIZE);
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
bcam.motion_position =
(Camera::MotionPosition)get_enum(cscene,
"motion_blur_position",
Camera::MOTION_NUM_POSITIONS,
Camera::MOTION_POSITION_CENTER);
bcam.rolling_shutter_type =
(Camera::RollingShutterType)get_enum(cscene,
"rolling_shutter_type",
Camera::ROLLING_SHUTTER_NUM_TYPES,
Camera::ROLLING_SHUTTER_NONE);
bcam.rolling_shutter_duration = RNA_float_get(&cscene, "rolling_shutter_duration");
/* border */
if(b_render.use_border()) {
bcam.border.left = b_render.border_min_x();
bcam.border.right = b_render.border_max_x();
bcam.border.bottom = b_render.border_min_y();
bcam.border.top = b_render.border_max_y();
}
/* camera object */
BL::Object b_ob = b_scene.camera();
if(b_override)
b_ob = b_override;
if(b_ob) {
BL::Array<float, 16> b_ob_matrix;
blender_camera_from_object(&bcam, b_engine, b_ob);
b_engine.camera_model_matrix(b_ob, bcam.use_spherical_stereo, b_ob_matrix);
bcam.matrix = get_transform(b_ob_matrix);
}
/* sync */
Camera *cam = scene->camera;
blender_camera_sync(cam, &bcam, width, height, viewname);
}
示例4: create_session
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Create the Blender session and all Octane session data structures
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void BlenderSession::create_session() {
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, interactive);
session_params.width = width;
session_params.height = height;
BL::RenderSettings r = b_scene.render();
motion_blur = r.use_motion_blur();
shuttertime = r.motion_blur_shutter();
mb_samples = r.motion_blur_samples();
mb_cur_sample = 0;
mb_sample_in_work = 0;
PointerRNA oct_scene = RNA_pointer_get(&b_scene.ptr, "octane");
mb_type = static_cast<MotionBlurType>(RNA_enum_get(&oct_scene, "mb_type"));
mb_direction = static_cast<MotionBlurDirection>(RNA_enum_get(&oct_scene, "mb_direction"));
mb_frame_time_sampling = motion_blur && mb_type == INTERNAL ? 1.0f / session_params.fps : -1.0f;
// Reset status/progress
last_status = "";
last_progress = -1.0f;
// Create session
string cur_path = blender_absolute_path(b_data, b_scene, b_scene.render().filepath().c_str());
cur_path += "/alembic_export.abc";
session = new Session(session_params, cur_path.c_str());
session->set_blender_session(this);
session->set_pause(BlenderSync::get_session_pause_state(b_scene, interactive));
// Create scene
scene = new Scene(session, interactive || !b_engine.is_animation() ? true : (b_scene.frame_current() == b_scene.frame_start()));
session->scene = scene;
scene->server = session->server;
// Create sync
sync = new BlenderSync(b_engine, b_data, b_scene, scene, interactive, session->progress);
if(b_rv3d)
sync->sync_view(b_v3d, b_rv3d, width, height);
else
sync->sync_camera(b_engine.camera_override(), width, height);
// Set buffer parameters
BufferParams buffer_params = BlenderSync::get_display_buffer_params(scene->camera, width, height);
if(interactive || !b_engine.is_animation() || b_scene.frame_current() == b_scene.frame_start())
session->reset(buffer_params, mb_frame_time_sampling);
} //create_session()
示例5: sync_camera
void BlenderSync::sync_camera(BL::RenderSettings& b_render,
BL::Object& b_override,
int width, int height)
{
BlenderCamera bcam;
blender_camera_init(&bcam, b_render);
/* pixel aspect */
bcam.pixelaspect.x = b_render.pixel_aspect_x();
bcam.pixelaspect.y = b_render.pixel_aspect_y();
bcam.shuttertime = b_render.motion_blur_shutter();
BL::CurveMapping b_shutter_curve(b_render.motion_blur_shutter_curve());
curvemapping_to_array(b_shutter_curve, bcam.shutter_curve, RAMP_TABLE_SIZE);
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
switch(RNA_enum_get(&cscene, "motion_blur_position")) {
case 0:
bcam.motion_position = Camera::MOTION_POSITION_START;
break;
case 1:
bcam.motion_position = Camera::MOTION_POSITION_CENTER;
break;
case 2:
bcam.motion_position = Camera::MOTION_POSITION_END;
break;
default:
bcam.motion_position = Camera::MOTION_POSITION_CENTER;
break;
}
switch(RNA_enum_get(&cscene, "rolling_shutter_type")) {
case 0:
bcam.rolling_shutter_type = Camera::ROLLING_SHUTTER_NONE;
break;
case 1:
bcam.rolling_shutter_type = Camera::ROLLING_SHUTTER_TOP;
break;
default:
bcam.rolling_shutter_type = Camera::ROLLING_SHUTTER_NONE;
break;
}
bcam.rolling_shutter_duration = RNA_float_get(&cscene, "rolling_shutter_duration");
/* border */
if(b_render.use_border()) {
bcam.border.left = b_render.border_min_x();
bcam.border.right = b_render.border_max_x();
bcam.border.bottom = b_render.border_min_y();
bcam.border.top = b_render.border_max_y();
}
/* camera object */
BL::Object b_ob = b_scene.camera();
if(b_override)
b_ob = b_override;
if(b_ob) {
BL::Array<float, 16> b_ob_matrix;
blender_camera_from_object(&bcam, b_engine, b_ob);
b_engine.camera_model_matrix(b_ob, b_ob_matrix);
bcam.matrix = get_transform(b_ob_matrix);
}
/* sync */
Camera *cam = scene->camera;
blender_camera_sync(cam, &bcam, width, height);
}