Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_volume.cpp
| Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | static void sync_smoke_volume(Scene *scene, BL::Object &b_ob, Volume *volume, float frame) | ||||
| for (int i = 0; attributes[i] != ATTR_STD_NONE; i++) { | for (int i = 0; attributes[i] != ATTR_STD_NONE; i++) { | ||||
| AttributeStandard std = attributes[i]; | AttributeStandard std = attributes[i]; | ||||
| if (!volume->need_attribute(scene, std)) { | if (!volume->need_attribute(scene, std)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| volume->set_clipping(b_domain.clipping()); | volume->set_clipping(b_domain.clipping()); | ||||
| Attribute *attr = volume->attributes.add(std); | Attribute *attr = volume->get_attributes().add(std); | ||||
| ImageLoader *loader = new BlenderSmokeLoader(b_ob, std); | ImageLoader *loader = new BlenderSmokeLoader(b_ob, std); | ||||
| ImageParams params; | ImageParams params; | ||||
| params.frame = frame; | params.frame = frame; | ||||
| attr->data_voxel() = scene->image_manager->add_image(loader, params); | attr->data_voxel() = scene->get_image_manager()->add_image(loader, params); | ||||
| } | } | ||||
| } | } | ||||
| class BlenderVolumeLoader : public VDBImageLoader { | class BlenderVolumeLoader : public VDBImageLoader { | ||||
| public: | public: | ||||
| BlenderVolumeLoader(BL::BlendData &b_data, BL::Volume &b_volume, const string &grid_name) | BlenderVolumeLoader(BL::BlendData &b_data, BL::Volume &b_volume, const string &grid_name) | ||||
| : VDBImageLoader(grid_name), b_volume(b_volume) | : VDBImageLoader(grid_name), b_volume(b_volume) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | else if (name == Attribute::standard_name(ATTR_STD_VOLUME_TEMPERATURE)) { | ||||
| std = ATTR_STD_VOLUME_TEMPERATURE; | std = ATTR_STD_VOLUME_TEMPERATURE; | ||||
| } | } | ||||
| else if (name == Attribute::standard_name(ATTR_STD_VOLUME_VELOCITY)) { | else if (name == Attribute::standard_name(ATTR_STD_VOLUME_VELOCITY)) { | ||||
| std = ATTR_STD_VOLUME_VELOCITY; | std = ATTR_STD_VOLUME_VELOCITY; | ||||
| } | } | ||||
| if ((std != ATTR_STD_NONE && volume->need_attribute(scene, std)) || | if ((std != ATTR_STD_NONE && volume->need_attribute(scene, std)) || | ||||
| volume->need_attribute(scene, name)) { | volume->need_attribute(scene, name)) { | ||||
| Attribute *attr = (std != ATTR_STD_NONE) ? | Attribute *attr = (std != ATTR_STD_NONE) ? volume->get_attributes().add(std) : | ||||
| volume->attributes.add(std) : | volume->get_attributes().add(name, | ||||
| volume->attributes.add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VOXEL); | TypeDesc::TypeFloat, | ||||
| ATTR_ELEMENT_VOXEL); | |||||
| ImageLoader *loader = new BlenderVolumeLoader(b_data, b_volume, name.string()); | ImageLoader *loader = new BlenderVolumeLoader(b_data, b_volume, name.string()); | ||||
| ImageParams params; | ImageParams params; | ||||
| params.frame = b_volume.grids.frame(); | params.frame = b_volume.grids.frame(); | ||||
| attr->data_voxel() = scene->image_manager->add_image(loader, params, false); | attr->data_voxel() = scene->get_image_manager()->add_image(loader, params, false); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void BlenderSync::sync_volume(BL::Object &b_ob, Volume *volume) | void BlenderSync::sync_volume(BL::Object &b_ob, Volume *volume) | ||||
| { | { | ||||
| volume->clear(true); | volume->clear(true); | ||||
| Show All 17 Lines | |||||