Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_view.c
| Show All 16 Lines | |||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup spview3d | * \ingroup spview3d | ||||
| */ | */ | ||||
| #include "DNA_camera_types.h" | #include "DNA_camera_types.h" | ||||
| #include "DNA_gpencil_modifier_types.h" | |||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_linklist.h" | #include "BLI_linklist.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| ▲ Show 20 Lines • Show All 911 Lines • ▼ Show 20 Lines | else { | ||||
| BLI_assert(0); | BLI_assert(0); | ||||
| } | } | ||||
| return continue_pass; | return continue_pass; | ||||
| } | } | ||||
| eV3DSelectObjectFilter ED_view3d_select_filter_from_mode(const Scene *scene, const Object *obact) | eV3DSelectObjectFilter ED_view3d_select_filter_from_mode(const Scene *scene, const Object *obact) | ||||
| { | { | ||||
| if (scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) { | if (scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) { | ||||
| if (obact && (obact->mode & OB_MODE_WEIGHT_PAINT) && | if (obact && ELEM(obact->mode, OB_MODE_WEIGHT_PAINT, OB_MODE_WEIGHT_GPENCIL) && | ||||
| BKE_object_pose_armature_get((Object *)obact)) { | BKE_object_pose_armature_get((Object *)obact)) { | ||||
| return VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK; | return VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK; | ||||
| } | } | ||||
| return VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK; | return VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK; | ||||
| } | } | ||||
| return VIEW3D_SELECT_FILTER_NOP; | return VIEW3D_SELECT_FILTER_NOP; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | case VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK: { | ||||
| if (obact && obact->mode != OB_MODE_OBJECT) { | if (obact && obact->mode != OB_MODE_OBJECT) { | ||||
| object_filter.fn = drw_select_filter_object_mode_lock; | object_filter.fn = drw_select_filter_object_mode_lock; | ||||
| object_filter.user_data = obact; | object_filter.user_data = obact; | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK: { | case VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK: { | ||||
| Object *obact = vc->obact; | Object *obact = vc->obact; | ||||
| BLI_assert(obact && (obact->mode & OB_MODE_WEIGHT_PAINT)); | BLI_assert(obact && ELEM(obact->mode, OB_MODE_WEIGHT_PAINT, OB_MODE_WEIGHT_GPENCIL)); | ||||
| /* While this uses 'alloca' in a loop (which we typically avoid), | /* While this uses 'alloca' in a loop (which we typically avoid), | ||||
| * the number of items is nearly always 1, maybe 2..3 in rare cases. */ | * the number of items is nearly always 1, maybe 2..3 in rare cases. */ | ||||
| LinkNode *ob_pose_list = NULL; | LinkNode *ob_pose_list = NULL; | ||||
| VirtualModifierData virtualModifierData; | VirtualModifierData virtualModifierData; | ||||
| const ModifierData *md = BKE_modifiers_get_virtual_modifierlist(obact, &virtualModifierData); | const ModifierData *md = BKE_modifiers_get_virtual_modifierlist(obact, &virtualModifierData); | ||||
| for (; md; md = md->next) { | for (; md; md = md->next) { | ||||
| if (md->type == eModifierType_Armature) { | if (md->type == eGpencilModifierType_Armature) { | ||||
| ArmatureGpencilModifierData *agmd = (ArmatureGpencilModifierData *)md; | |||||
| if (agmd->object && (agmd->object->mode & OB_MODE_POSE)) { | |||||
| BLI_linklist_prepend_alloca(&ob_pose_list, agmd->object); | |||||
| } | |||||
| } | |||||
| else if (md->type == eModifierType_Armature) { | |||||
| ArmatureModifierData *amd = (ArmatureModifierData *)md; | ArmatureModifierData *amd = (ArmatureModifierData *)md; | ||||
| if (amd->object && (amd->object->mode & OB_MODE_POSE)) { | if (amd->object && (amd->object->mode & OB_MODE_POSE)) { | ||||
| BLI_linklist_prepend_alloca(&ob_pose_list, amd->object); | BLI_linklist_prepend_alloca(&ob_pose_list, amd->object); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| object_filter.fn = drw_select_filter_object_mode_lock_for_weight_paint; | object_filter.fn = drw_select_filter_object_mode_lock_for_weight_paint; | ||||
| object_filter.user_data = ob_pose_list; | object_filter.user_data = ob_pose_list; | ||||
| ▲ Show 20 Lines • Show All 700 Lines • Show Last 20 Lines | |||||