40 BL::BlendData &b_data,
44 bool use_developer_ui,
48 void reset(BL::BlendData &b_data, BL::Scene &b_scene);
55 void sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d, BL::RegionView3D &b_rv3d);
56 void sync_data(BL::RenderSettings &b_render,
57 BL::Depsgraph &b_depsgraph,
58 BL::SpaceView3D &b_v3d,
59 BL::RegionView3D &b_rv3d,
62 void **python_thread_state,
72 const char *viewname);
74 BL::RegionView3D &b_rv3d,
79 return view_layer.samples;
83 return view_layer.bound_samples;
91 const bool background,
92 const bool use_developer_ui);
94 BL::Preferences &b_preferences,
99 BL::RegionView3D &b_rv3d,
105 BL::ViewLayer &b_view_layer,
111 void sync_lights(BL::Depsgraph &b_depsgraph,
bool update_all);
112 void sync_materials(BL::Depsgraph &b_depsgraph,
bool update_all);
113 void sync_objects(BL::Depsgraph &b_depsgraph,
114 BL::SpaceView3D &b_v3d,
115 const float motion_time = 0.0f);
116 void sync_motion(BL::RenderSettings &b_render,
117 BL::Depsgraph &b_depsgraph,
118 BL::SpaceView3D &b_v3d,
119 BL::RegionView3D &b_rv3d,
122 void **python_thread_state);
123 void sync_film(BL::ViewLayer &b_view_layer, BL::SpaceView3D &b_v3d);
128 void sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d,
bool update_all);
129 void sync_shaders(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d,
bool update_all);
130 void sync_nodes(
Shader *shader, BL::ShaderNodeTree &b_ntree);
132 bool scene_attr_needs_recalc(
Shader *shader, BL::Depsgraph &b_depsgraph);
133 void resolve_view_layer_attributes(
Shader *shader,
135 BL::Depsgraph &b_depsgraph);
138 Object *sync_object(BL::ViewLayer &b_view_layer,
139 BL::DepsgraphObjectInstance &b_instance,
140 const float motion_time,
141 bool use_particle_hair,
145 void sync_object_motion_init(BL::Object &b_parent, BL::Object &b_ob,
Object *
object);
147 void sync_procedural(BL::Object &b_ob,
148 BL::MeshSequenceCacheModifier &b_mesh_cache,
149 bool has_subdivision);
151 bool sync_object_attributes(BL::DepsgraphObjectInstance &b_instance,
Object *
object);
158 void sync_mesh_motion(
BObjectInfo &b_ob_info,
Mesh *mesh,
int motion_step);
162 void sync_hair_motion(
BObjectInfo &b_ob_info,
Hair *hair,
int motion_step);
163 void sync_hair(
Hair *hair,
BObjectInfo &b_ob_info,
bool motion,
const int motion_step = 0);
164 void sync_particle_hair(
Hair *hair,
168 const int motion_step = 0);
169 bool object_has_particle_hair(BL::Object b_ob);
173 void sync_pointcloud_motion(
PointCloud *pointcloud,
175 const int motion_step = 0);
178 void sync_camera_motion(BL::RenderSettings &b_render,
182 const float motion_time);
187 bool use_particle_hair,
192 const float motion_time,
193 bool use_particle_hair,
198 void sync_background_light(BL::SpaceView3D &b_v3d);
201 bool sync_dupli_particle(BL::Object &b_ob,
202 BL::DepsgraphObjectInstance &b_instance,
212 bool object_can_have_geometry(BL::Object &b_ob);
213 bool object_is_light(BL::Object &b_ob);
214 bool object_is_camera(BL::Object &b_ob);
216 BL::Object get_camera_object(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d);
217 BL::Object get_dicing_camera_object(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d);
220 BL::RenderEngine b_engine;
221 BL::BlendData b_data;
223 BL::Object b_bake_target;
225 enum ShaderFlags { SHADER_WITH_LAYER_ATTRS };
227 id_map<void *, Shader, ShaderFlags> shader_map;
228 id_map<ObjectKey, Object> object_map;
229 id_map<void *, Procedural> procedural_map;
230 id_map<GeometryKey, Geometry> geometry_map;
231 id_map<ParticleSystemKey, ParticleSystem> particle_system_map;
232 set<Geometry *> geometry_synced;
233 set<Geometry *> geometry_motion_synced;
234 set<Geometry *> geometry_motion_attribute_synced;
236 map<void *, set<BL::ID>> instance_geometries_by_object;
237 set<float> motion_times;
240 BlenderViewportParameters viewport_parameters;
244 bool use_adaptive_subdivision =
false;
245 bool use_developer_ui;
250 int max_subdivisions;
252 struct RenderLayerInfo {
256 BL::Material material_override;
257 BL::World world_override;
258 bool use_background_shader =
true;
259 bool use_surfaces =
true;
260 bool use_hair =
true;
261 bool use_volumes =
true;
262 bool use_motion_blur =
true;
264 bool bound_samples =
false;
272 bool has_updates_ =
true;