[Bf-blender-cvs] [36152afa762] blender2.8: Merge branch 'master' into blender2.8
Campbell Barton
noreply at git.blender.org
Sat Apr 14 14:34:50 CEST 2018
Commit: 36152afa7623943e578600cab1cd355efae1fe0e
Author: Campbell Barton
Date: Sat Apr 14 14:34:21 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB36152afa7623943e578600cab1cd355efae1fe0e
Merge branch 'master' into blender2.8
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_object.h
index ff05ffc8df7,7cc43f33e3a..c698db2e8f5
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@@ -80,19 -78,11 +80,19 @@@ void BKE_object_free_modifiers(struct O
void BKE_object_make_proxy(struct Object *ob, struct Object *target, struct Object *gob);
void BKE_object_copy_proxy_drivers(struct Object *ob, struct Object *target);
- bool BKE_object_exists_check(struct Object *obtest);
- bool BKE_object_is_in_editmode(struct Object *ob);
- bool BKE_object_is_in_editmode_vgroup(struct Object *ob);
+ bool BKE_object_exists_check(const struct Object *obtest);
+ bool BKE_object_is_in_editmode(const struct Object *ob);
+ bool BKE_object_is_in_editmode_vgroup(const struct Object *ob);
bool BKE_object_is_in_wpaint_select_vert(const struct Object *ob);
+typedef enum eObjectVisibilityCheck {
+ OB_VISIBILITY_CHECK_FOR_VIEWPORT,
+ OB_VISIBILITY_CHECK_FOR_RENDER,
+ OB_VISIBILITY_CHECK_UNKNOWN_RENDER_MODE,
+} eObjectVisibilityCheck;
+
+bool BKE_object_is_visible(struct Object *ob, const eObjectVisibilityCheck mode);
+
void BKE_object_init(struct Object *ob);
struct Object *BKE_object_add_only_object(
struct Main *bmain,
@@@ -136,22 -122,16 +136,22 @@@ void BKE_object_to_mat4(struct Object *
void BKE_object_apply_mat4(struct Object *ob, float mat[4][4], const bool use_compat, const bool use_parent);
void BKE_object_matrix_local_get(struct Object *ob, float mat[4][4]);
- bool BKE_object_pose_context_check(struct Object *ob);
+ bool BKE_object_pose_context_check(const struct Object *ob);
struct Object *BKE_object_pose_armature_get(struct Object *ob);
+struct Object *BKE_object_pose_armature_get_visible(struct Object *ob, struct ViewLayer *view_layer);
-void BKE_object_get_parent_matrix(struct Scene *scene, struct Object *ob, struct Object *par, float parentmat[4][4]);
-void BKE_object_where_is_calc(struct Scene *scene, struct Object *ob);
+void BKE_object_get_parent_matrix(
+ struct Scene *scene, struct Object *ob,
+ struct Object *par, float parentmat[4][4]);
+void BKE_object_where_is_calc(
+ const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
void BKE_object_where_is_calc_ex(
- struct Scene *scene, struct RigidBodyWorld *rbw, struct Object *ob, float r_originmat[3][3]);
-void BKE_object_where_is_calc_time(struct Scene *scene, struct Object *ob, float ctime);
+ const struct EvaluationContext *eval_ctx, struct Scene *scene, struct RigidBodyWorld *rbw,
+ struct Object *ob, float r_originmat[3][3]);
+void BKE_object_where_is_calc_time(
+ const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob, float ctime);
void BKE_object_where_is_calc_time_ex(
- struct Scene *scene, struct Object *ob, float ctime,
+ const struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob, float ctime,
struct RigidBodyWorld *rbw, float r_originmat[3][3]);
void BKE_object_where_is_calc_mat4(struct Scene *scene, struct Object *ob, float obmat[4][4]);
diff --cc source/blender/blenkernel/intern/object.c
index 67769c9ae3b,22a4db94d07..875d716305f
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@@ -548,37 -529,7 +548,37 @@@ bool BKE_object_is_in_wpaint_select_ver
return false;
}
+/**
+ * Return if the object is visible, as evaluated by depsgraph
+ */
+bool BKE_object_is_visible(Object *ob, const eObjectVisibilityCheck mode)
+{
+ if ((ob->base_flag & BASE_VISIBLED) == 0) {
+ return false;
+ }
+
+ if (mode == OB_VISIBILITY_CHECK_UNKNOWN_RENDER_MODE) {
+ return true;
+ }
+
+ if (((ob->transflag & OB_DUPLI) == 0) &&
+ (ob->particlesystem.first == NULL))
+ {
+ return true;
+ }
+
+ switch (mode) {
+ case OB_VISIBILITY_CHECK_FOR_VIEWPORT:
+ return ((ob->duplicator_visibility_flag & OB_DUPLI_FLAG_VIEWPORT) != 0);
+ case OB_VISIBILITY_CHECK_FOR_RENDER:
+ return ((ob->duplicator_visibility_flag & OB_DUPLI_FLAG_RENDER) != 0);
+ default:
+ BLI_assert(!"Object visible test mode not supported.");
+ return false;
+ }
+}
+
- bool BKE_object_exists_check(Object *obtest)
+ bool BKE_object_exists_check(const Object *obtest)
{
Object *ob;
More information about the Bf-blender-cvs
mailing list