Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/object.cpp26
-rw-r--r--intern/cycles/blender/sync.cpp8
-rw-r--r--intern/cycles/blender/sync.h3
3 files changed, 28 insertions, 9 deletions
diff --git a/intern/cycles/blender/object.cpp b/intern/cycles/blender/object.cpp
index 698800f9957..0ad3e551b8d 100644
--- a/intern/cycles/blender/object.cpp
+++ b/intern/cycles/blender/object.cpp
@@ -62,15 +62,15 @@ bool BlenderSync::BKE_object_is_modified(BL::Object &b_ob)
return false;
}
-bool BlenderSync::object_is_geometry(BL::Object &b_ob)
+bool BlenderSync::object_is_geometry(BObjectInfo &b_ob_info)
{
- BL::ID b_ob_data = b_ob.data();
+ BL::ID b_ob_data = b_ob_info.object_data;
if (!b_ob_data) {
return false;
}
- BL::Object::type_enum type = b_ob.type();
+ BL::Object::type_enum type = b_ob_info.iter_object.type();
if (type == BL::Object::type_VOLUME || type == BL::Object::type_HAIR) {
/* Will be exported attached to mesh. */
@@ -87,6 +87,24 @@ bool BlenderSync::object_is_geometry(BL::Object &b_ob)
return b_ob_data.is_a(&RNA_Mesh);
}
+bool BlenderSync::object_can_have_geometry(BL::Object &b_ob)
+{
+ BL::Object::type_enum type = b_ob.type();
+ switch (type) {
+ case BL::Object::type_MESH:
+ case BL::Object::type_CURVE:
+ case BL::Object::type_SURFACE:
+ case BL::Object::type_META:
+ case BL::Object::type_FONT:
+ case BL::Object::type_HAIR:
+ case BL::Object::type_POINTCLOUD:
+ case BL::Object::type_VOLUME:
+ return true;
+ default:
+ return false;
+ }
+}
+
bool BlenderSync::object_is_light(BL::Object &b_ob)
{
BL::ID b_ob_data = b_ob.data();
@@ -189,7 +207,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
}
/* only interested in object that we can create meshes from */
- if (!object_is_geometry(b_ob)) {
+ if (!object_is_geometry(b_ob_info)) {
return NULL;
}
diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp
index ffd1e78b7f8..92662e37bc2 100644
--- a/intern/cycles/blender/sync.cpp
+++ b/intern/cycles/blender/sync.cpp
@@ -162,19 +162,19 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
/* Object */
else if (b_id.is_a(&RNA_Object)) {
BL::Object b_ob(b_id);
- const bool is_geometry = object_is_geometry(b_ob);
- const bool is_light = !is_geometry && object_is_light(b_ob);
+ const bool can_have_geometry = object_can_have_geometry(b_ob);
+ const bool is_light = !can_have_geometry && object_is_light(b_ob);
if (b_ob.is_instancer() && b_update.is_updated_shading()) {
/* Needed for e.g. object color updates on instancer. */
object_map.set_recalc(b_ob);
}
- if (is_geometry || is_light) {
+ if (can_have_geometry || is_light) {
const bool updated_geometry = b_update.is_updated_geometry();
/* Geometry (mesh, hair, volume). */
- if (is_geometry) {
+ if (can_have_geometry) {
if (b_update.is_updated_transform() || b_update.is_updated_shading()) {
object_map.set_recalc(b_ob);
}
diff --git a/intern/cycles/blender/sync.h b/intern/cycles/blender/sync.h
index 7e5d0324ca9..98197564bec 100644
--- a/intern/cycles/blender/sync.h
+++ b/intern/cycles/blender/sync.h
@@ -208,7 +208,8 @@ class BlenderSync {
/* util */
void find_shader(BL::ID &id, array<Node *> &used_shaders, Shader *default_shader);
bool BKE_object_is_modified(BL::Object &b_ob);
- bool object_is_geometry(BL::Object &b_ob);
+ bool object_is_geometry(BObjectInfo &b_ob_info);
+ bool object_can_have_geometry(BL::Object &b_ob);
bool object_is_light(BL::Object &b_ob);
/* variables */