Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager.c
| Show All 38 Lines | |||||
| #include "BKE_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BKE_lattice.h" | #include "BKE_lattice.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_mball.h" | #include "BKE_mball.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_pbvh.h" | |||||
| #include "BKE_pointcache.h" | #include "BKE_pointcache.h" | ||||
| #include "draw_manager.h" | #include "draw_manager.h" | ||||
| #include "DNA_camera_types.h" | #include "DNA_camera_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "DNA_world_types.h" | #include "DNA_world_types.h" | ||||
| ▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | switch (ob->mode) { | ||||
| case OB_MODE_WEIGHT_PAINT: | case OB_MODE_WEIGHT_PAINT: | ||||
| return (me->editflag & (ME_EDIT_PAINT_FACE_SEL | ME_EDIT_PAINT_VERT_SEL)) != 0; | return (me->editflag & (ME_EDIT_PAINT_FACE_SEL | ME_EDIT_PAINT_VERT_SEL)) != 0; | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* Should we use PBVH drawing or regular mesh drawing | |||||
| * PBVH drawing should be used for | |||||
| * - Multires | |||||
| * - Dyntopo | |||||
| * - Normal sculpt without any active modifiers | |||||
| */ | |||||
| bool DRW_object_use_pbvh_drawing(const struct Object *ob) | bool DRW_object_use_pbvh_drawing(const struct Object *ob) | ||||
| { | { | ||||
| return ob->sculpt && (ob->sculpt->mode_type == OB_MODE_SCULPT); | SculptSession *ss = ob->sculpt; | ||||
| if (ss == NULL || ss->pbvh == NULL || ob->sculpt->mode_type != OB_MODE_SCULPT) { | |||||
brecht: This seems to disable PBVH drawing even when there are no modifiers? For example just sculpting… | |||||
| return false; | |||||
| } | |||||
| if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES) { | |||||
| return !(ss->kb || ss->modifiers_active); | |||||
| } | |||||
| else { | |||||
| /* Multires/Dyntopo */ | |||||
| return true; | |||||
| } | |||||
| } | } | ||||
| bool DRW_object_is_visible_psys_in_active_context(const Object *object, const ParticleSystem *psys) | bool DRW_object_is_visible_psys_in_active_context(const Object *object, const ParticleSystem *psys) | ||||
| { | { | ||||
| const bool for_render = DRW_state_is_image_render(); | const bool for_render = DRW_state_is_image_render(); | ||||
| /* NOTE: psys_check_enabled is using object and particle system for only | /* NOTE: psys_check_enabled is using object and particle system for only | ||||
| * reading, but is using some other functions which are more generic and | * reading, but is using some other functions which are more generic and | ||||
| * which are hard to make const-pointer. */ | * which are hard to make const-pointer. */ | ||||
| ▲ Show 20 Lines • Show All 3,042 Lines • Show Last 20 Lines | |||||
This seems to disable PBVH drawing even when there are no modifiers? For example just sculpting in the Sculpting template