Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/object.c
| Show First 20 Lines • Show All 526 Lines • ▼ Show 20 Lines | else if (ob->type == OB_SURF || ob->type == OB_CURVE) { | ||||
| Curve *cu = ob->data; | Curve *cu = ob->data; | ||||
| if (cu->editnurb) | if (cu->editnurb) | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| bool BKE_object_is_in_editmode_and_selected(const Object *ob) | |||||
| { | |||||
| if ((ob->flag & SELECT) && (BKE_object_is_in_editmode(ob))) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| bool BKE_object_is_in_editmode_vgroup(Object *ob) | bool BKE_object_is_in_editmode_vgroup(Object *ob) | ||||
| { | { | ||||
| return (OB_TYPE_SUPPORT_VGROUP(ob->type) && | return (OB_TYPE_SUPPORT_VGROUP(ob->type) && | ||||
| BKE_object_is_in_editmode(ob)); | BKE_object_is_in_editmode(ob)); | ||||
| } | } | ||||
| bool BKE_object_is_in_wpaint_select_vert(const Object *ob, eObjectMode object_mode) | bool BKE_object_is_in_wpaint_select_vert(const Object *ob, eObjectMode object_mode) | ||||
| { | { | ||||
| if (ob->type == OB_MESH) { | if (ob->type == OB_MESH) { | ||||
| const Mesh *me = ob->data; | const Mesh *me = ob->data; | ||||
| return ((object_mode & OB_MODE_WEIGHT_PAINT) && | return ((object_mode & OB_MODE_WEIGHT_PAINT) && | ||||
| (me->edit_btmesh == NULL) && | (me->edit_btmesh == NULL) && | ||||
| (ME_EDIT_PAINT_SEL_MODE(me) == SCE_SELECT_VERTEX)); | (ME_EDIT_PAINT_SEL_MODE(me) == SCE_SELECT_VERTEX)); | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| bool BKE_object_has_mode_data(const struct Object *ob, eObjectMode object_mode) | |||||
| { | |||||
| if (object_mode & OB_MODE_EDIT) { | |||||
| if (BKE_object_is_in_editmode(ob)) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| else if (object_mode & OB_MODE_VERTEX_PAINT) { | |||||
| if (ob->sculpt && (ob->sculpt->mode_type == OB_MODE_VERTEX_PAINT)) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| else if (object_mode & OB_MODE_WEIGHT_PAINT) { | |||||
| if (ob->sculpt && (ob->sculpt->mode_type == OB_MODE_WEIGHT_PAINT)) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| else if (object_mode & OB_MODE_SCULPT) { | |||||
| if (ob->sculpt && (ob->sculpt->mode_type == OB_MODE_SCULPT)) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
| /** | /** | ||||
| * Return if the object is visible, as evaluated by depsgraph | * Return if the object is visible, as evaluated by depsgraph | ||||
| */ | */ | ||||
| bool BKE_object_is_visible(Object *ob, const eObjectVisibilityCheck mode) | bool BKE_object_is_visible(Object *ob, const eObjectVisibilityCheck mode) | ||||
| { | { | ||||
| if ((ob->base_flag & BASE_VISIBLED) == 0) { | if ((ob->base_flag & BASE_VISIBLED) == 0) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 3,234 Lines • Show Last 20 Lines | |||||