[Bf-blender-cvs] [aa20e7b88f0] soc-2018-cycles-volumes: Merge remote-tracking branch 'origin/blender2.8' into soc-2018-cycles-volumes
Geraldine Chua
noreply at git.blender.org
Fri Aug 10 07:31:56 CEST 2018
Commit: aa20e7b88f02544458467868423f48e878034e52
Author: Geraldine Chua
Date: Fri Aug 10 13:27:40 2018 +0800
Branches: soc-2018-cycles-volumes
https://developer.blender.org/rBaa20e7b88f02544458467868423f48e878034e52
Merge remote-tracking branch 'origin/blender2.8' into soc-2018-cycles-volumes
===================================================================
===================================================================
diff --cc intern/cycles/blender/addon/properties.py
index 1b911747899,7f0cb7e875f..54b02a62682
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@@ -1070,75 -1073,68 +1073,74 @@@ class CyclesObjectSettings(bpy.types.Pr
@classmethod
def register(cls):
bpy.types.Object.cycles = PointerProperty(
- name="Cycles Object Settings",
- description="Cycles object settings",
- type=cls,
- )
+ name="Cycles Object Settings",
+ description="Cycles object settings",
+ type=cls,
+ )
cls.use_motion_blur = BoolProperty(
- name="Use Motion Blur",
- description="Use motion blur for this object",
- default=True,
- )
+ name="Use Motion Blur",
+ description="Use motion blur for this object",
+ default=True,
+ )
cls.use_deform_motion = BoolProperty(
- name="Use Deformation Motion",
- description="Use deformation motion blur for this object",
- default=True,
- )
+ name="Use Deformation Motion",
+ description="Use deformation motion blur for this object",
+ default=True,
+ )
+ cls.use_volume_motion = BoolProperty(
- name="Use Volume Motion",
- description="Use volume motion blur for this object",
- default=False,
- )
++ name="Use Volume Motion",
++ description="Use volume motion blur for this object",
++ default=False,
++ )
+
cls.motion_steps = IntProperty(
- name="Motion Steps",
- description="Control accuracy of motion blur, more steps gives more memory usage (actual number of steps is 2^(steps - 1))",
- min=1, soft_max=8,
- default=1,
- )
+ name="Motion Steps",
+ description="Control accuracy of motion blur, more steps gives more memory usage (actual number of steps is 2^(steps - 1))",
+ min=1, soft_max=8,
+ default=1,
+ )
cls.use_camera_cull = BoolProperty(
- name="Use Camera Cull",
- description="Allow this object and its duplicators to be culled by camera space culling",
- default=False,
- )
+ name="Use Camera Cull",
+ description="Allow this object and its duplicators to be culled by camera space culling",
+ default=False,
+ )
cls.use_distance_cull = BoolProperty(
- name="Use Distance Cull",
- description="Allow this object and its duplicators to be culled by distance from camera",
- default=False,
- )
+ name="Use Distance Cull",
+ description="Allow this object and its duplicators to be culled by distance from camera",
+ default=False,
+ )
cls.use_adaptive_subdivision = BoolProperty(
- name="Use Adaptive Subdivision",
- description="Use adaptive render time subdivision",
- default=False,
- )
+ name="Use Adaptive Subdivision",
+ description="Use adaptive render time subdivision",
+ default=False,
+ )
cls.dicing_rate = FloatProperty(
- name="Dicing Scale",
- description="Multiplier for scene dicing rate (located in the Geometry Panel)",
- min=0.1, max=1000.0, soft_min=0.5,
- default=1.0,
- )
+ name="Dicing Scale",
+ description="Multiplier for scene dicing rate (located in the Geometry Panel)",
+ min=0.1, max=1000.0, soft_min=0.5,
+ default=1.0,
+ )
cls.is_shadow_catcher = BoolProperty(
- name="Shadow Catcher",
- description="Only render shadows on this object, for compositing renders into real footage",
- default=False,
- )
+ name="Shadow Catcher",
+ description="Only render shadows on this object, for compositing renders into real footage",
+ default=False,
+ )
cls.is_holdout = BoolProperty(
- name="Holdout",
- description="Render objects as a holdout or matte, creating a "
- "hole in the image with zero alpha, to fill out in "
- "compositing with real footange or another render",
- default=False,
- )
-
+ name="Holdout",
+ description="Render objects as a holdout or matte, creating a "
+ "hole in the image with zero alpha, to fill out in "
+ "compositing with real footange or another render",
+ default=False,
+ )
@classmethod
def unregister(cls):
diff --cc intern/cycles/blender/blender_mesh.cpp
index 0281ef0a249,8a6480a9a42..e8b181be106
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@@ -324,39 -324,35 +324,40 @@@ static void mikk_compute_tangents(cons
/* Create Volume Attribute */
-static void create_mesh_volume_attribute(BL::Object& b_ob,
- Mesh *mesh,
+static void create_mesh_volume_attribute(Mesh *mesh,
ImageManager *image_manager,
AttributeStandard std,
+ string filename,
+ void *builtin_data,
float frame)
{
- BL::SmokeDomainSettings b_domain = object_smoke_domain_find(b_ob);
-
- if(!b_domain)
- return;
-
- mesh->volume_isovalue = b_domain.clipping();
+ ImageMetaData metadata;
-
++ string grid_name;
+ if(filename.empty()) {
+ /* Built-in smoke. */
+ filename = Attribute::standard_name(std);
+ }
+ else {
+ /* External VDB. */
- metadata.grid_name = Attribute::standard_name(std);
++ grid_name = Attribute::standard_name(std);
+ }
Attribute *attr = mesh->attributes.add(std);
VoxelAttribute *volume_data = attr->data_voxel();
volume_data->manager = image_manager;
volume_data->slot = image_manager->add_image(
- Attribute::standard_name(std),
- b_ob.ptr.data,
- animated,
- frame,
- INTERPOLATION_LINEAR,
- EXTENSION_CLIP,
- use_alpha,
- metadata);
+ filename,
++ grid_name,
+ builtin_data,
+ false,
+ frame,
+ INTERPOLATION_LINEAR,
+ EXTENSION_CLIP,
+ true,
+ true,
- mesh->volume_isovalue,
++ mesh->volume_isovalue,
+ metadata);
}
static void create_mesh_volume_attributes(Scene *scene,
@@@ -366,38 -361,18 +367,40 @@@
float frame)
{
/* for smoke volume rendering */
+ BL::SmokeDomainSettings b_domain = object_smoke_domain_find(b_ob);
+
+ if(!b_domain)
+ return;
+
+ string filename;
+ void *builtin_data = NULL;
+
+ if(volume_get_frame_file(b_data, b_ob, b_domain, (int)frame, filename)) {
++#ifdef WITH_OPENVDB
+ if(string_endswith(filename, ".vdb")) {
+ init_openvdb_in_scene(scene->params.intialized_openvdb);
+ }
++#endif
+ }
+ else {
+ filename = string();
+ builtin_data = b_ob.ptr.data;
+ }
+
+ mesh->volume_isovalue = b_domain.clipping();
+
if(mesh->need_attribute(scene, ATTR_STD_VOLUME_DENSITY))
- create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_DENSITY, frame);
+ create_mesh_volume_attribute(mesh, scene->image_manager, ATTR_STD_VOLUME_DENSITY, filename, builtin_data, frame);
if(mesh->need_attribute(scene, ATTR_STD_VOLUME_COLOR))
- create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_COLOR, frame);
+ create_mesh_volume_attribute(mesh, scene->image_manager, ATTR_STD_VOLUME_COLOR, filename, builtin_data, frame);
if(mesh->need_attribute(scene, ATTR_STD_VOLUME_FLAME))
- create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_FLAME, frame);
+ create_mesh_volume_attribute(mesh, scene->image_manager, ATTR_STD_VOLUME_FLAME, filename, builtin_data, frame);
if(mesh->need_attribute(scene, ATTR_STD_VOLUME_HEAT))
- create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_HEAT, frame);
+ create_mesh_volume_attribute(mesh, scene->image_manager, ATTR_STD_VOLUME_HEAT, filename, builtin_data, frame);
if(mesh->need_attribute(scene, ATTR_STD_VOLUME_TEMPERATURE))
- create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_TEMPERATURE, frame);
- if(mesh->need_attribute(scene, ATTR_STD_VOLUME_VELOCITY))
- create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_VELOCITY, frame);
+ create_mesh_volume_attribute(mesh, scene->image_manager, ATTR_STD_VOLUME_TEMPERATURE, filename, builtin_data, frame);
+ if(mesh->need_attribute(scene, ATTR_STD_VOLUME_VELOCITY) || mesh->use_volume_motion_blur)
+ create_mesh_volume_attribute(mesh, scene->image_manager, ATTR_STD_VOLUME_VELOCITY, filename, builtin_data, frame);
}
/* Create vertex color attributes. */
@@@ -1225,16 -1186,12 +1214,12 @@@ Mesh *BlenderSync::sync_mesh(BL::Depsgr
else
create_mesh(scene, mesh, b_mesh, used_shaders, false);
- create_mesh_volume_attributes(scene, b_ob, mesh, b_scene.frame_current());
+ create_mesh_volume_attributes(scene, b_data, b_ob, mesh, b_scene.frame_current());
}
- if(render_layer.use_hair && mesh->subdivision_type == Mesh::SUBDIVISION_NONE)
+ if(view_layer.use_hair && mesh->subdivision_type == Mesh::SUBDIVISION_NONE)
sync_curves(mesh, b_mesh, b_ob, false);
- if(can_free_caches) {
- b_ob.cache_release();
- }
-
/* free derived mesh */
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list