Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/drawobject.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_pointcache.h" | #include "BKE_pointcache.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_subsurf.h" | #include "BKE_subsurf.h" | ||||
| #include "BKE_unit.h" | #include "BKE_unit.h" | ||||
| #include "BKE_tracking.h" | #include "BKE_tracking.h" | ||||
| #include "BKE_gpencil.h" | |||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "IMB_imbuf.h" | #include "IMB_imbuf.h" | ||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| ▲ Show 20 Lines • Show All 8,071 Lines • ▼ Show 20 Lines | else if (ob->type == OB_MBALL) { | ||||
| } | } | ||||
| } | } | ||||
| else if (ob->type == OB_ARMATURE) { | else if (ob->type == OB_ARMATURE) { | ||||
| bb = BKE_armature_boundbox_get(ob); | bb = BKE_armature_boundbox_get(ob); | ||||
| } | } | ||||
| else if (ob->type == OB_LATTICE) { | else if (ob->type == OB_LATTICE) { | ||||
| bb = BKE_lattice_boundbox_get(ob); | bb = BKE_lattice_boundbox_get(ob); | ||||
| } | } | ||||
| else if (ob->type == OB_GPENCIL) { | |||||
| bb = BKE_gpencil_boundbox_get(ob); | |||||
| } | |||||
| else { | else { | ||||
| const float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {1.0f, 1.0f, 1.0f}; | const float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {1.0f, 1.0f, 1.0f}; | ||||
| bb = &bb_local; | bb = &bb_local; | ||||
| BKE_boundbox_init_from_minmax(bb, min, max); | BKE_boundbox_init_from_minmax(bb, min, max); | ||||
| } | } | ||||
| if (bb == NULL) | if (bb == NULL) | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 288 Lines • ▼ Show 20 Lines | else { | ||||
| if ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL)) { | if ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL)) { | ||||
| theme_id = sl->basact == base ? TH_ACTIVE : TH_SELECT; | theme_id = sl->basact == base ? TH_ACTIVE : TH_SELECT; | ||||
| } | } | ||||
| else { | else { | ||||
| if (ob->type == OB_LAMP) theme_id = TH_LAMP; | if (ob->type == OB_LAMP) theme_id = TH_LAMP; | ||||
| else if (ob->type == OB_SPEAKER) theme_id = TH_SPEAKER; | else if (ob->type == OB_SPEAKER) theme_id = TH_SPEAKER; | ||||
| else if (ob->type == OB_CAMERA) theme_id = TH_CAMERA; | else if (ob->type == OB_CAMERA) theme_id = TH_CAMERA; | ||||
| else if (ob->type == OB_EMPTY) theme_id = TH_EMPTY; | else if (ob->type == OB_EMPTY) theme_id = TH_EMPTY; | ||||
| else if (ob->type == OB_GPENCIL) theme_id = TH_EMPTY; | |||||
| /* fallback to TH_WIRE */ | /* fallback to TH_WIRE */ | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* finally set the color */ | /* finally set the color */ | ||||
| if (colindex == 0) { | if (colindex == 0) { | ||||
| ▲ Show 20 Lines • Show All 352 Lines • ▼ Show 20 Lines | #endif | ||||
| if (ob->empty_drawtype == OB_EMPTY_IMAGE) { | if (ob->empty_drawtype == OB_EMPTY_IMAGE) { | ||||
| draw_empty_image(ob, dflag, ob_wire_col, v3d->multiview_eye); | draw_empty_image(ob, dflag, ob_wire_col, v3d->multiview_eye); | ||||
| } | } | ||||
| else { | else { | ||||
| drawaxes(rv3d->viewmatob, ob->empty_drawsize, ob->empty_drawtype, ob_wire_col); | drawaxes(rv3d->viewmatob, ob->empty_drawsize, ob->empty_drawtype, ob_wire_col); | ||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| case OB_GPENCIL: | |||||
| if (!render_override) { | |||||
| drawaxes(rv3d->viewmatob, ob->empty_drawsize, ob->empty_drawtype, ob_wire_col); | |||||
| /* draw small box to make different of empty type */ | |||||
| drawaxes(rv3d->viewmatob, ob->empty_drawsize / 4.0f, OB_CUBE, ob_wire_col); | |||||
| } | |||||
| break; | |||||
| case OB_LAMP: | case OB_LAMP: | ||||
| if (!render_override) { | if (!render_override) { | ||||
| drawlamp(v3d, rv3d, base, dt, dflag, ob_wire_col, is_obact); | drawlamp(v3d, rv3d, base, dt, dflag, ob_wire_col, is_obact); | ||||
| } | } | ||||
| break; | break; | ||||
| case OB_CAMERA: | case OB_CAMERA: | ||||
| if (!render_override || | if (!render_override || | ||||
| (rv3d->persp == RV3D_CAMOB && v3d->camera == ob)) /* special exception for active camera */ | (rv3d->persp == RV3D_CAMOB && v3d->camera == ob)) /* special exception for active camera */ | ||||
| ▲ Show 20 Lines • Show All 1,029 Lines • ▼ Show 20 Lines | switch (ob->type) { | ||||
| case OB_EMPTY: | case OB_EMPTY: | ||||
| if (ob->empty_drawtype == OB_EMPTY_IMAGE) { | if (ob->empty_drawtype == OB_EMPTY_IMAGE) { | ||||
| draw_empty_image(ob, 0, bcol, v3d->multiview_eye); | draw_empty_image(ob, 0, bcol, v3d->multiview_eye); | ||||
| } | } | ||||
| else { | else { | ||||
| drawaxes(rv3d->viewmatob, ob->empty_drawsize, ob->empty_drawtype, bcol); | drawaxes(rv3d->viewmatob, ob->empty_drawsize, ob->empty_drawtype, bcol); | ||||
| } | } | ||||
| break; | break; | ||||
| case OB_GPENCIL: | |||||
| drawaxes(rv3d->viewmatob, ob->empty_drawsize, ob->empty_drawtype, NULL); | |||||
| /* draw small box to make different of empty type */ | |||||
| drawaxes(rv3d->viewmatob, ob->empty_drawsize / 4.0f, OB_CUBE, NULL); | |||||
| break; | |||||
| } | } | ||||
| } | } | ||||
| void ED_draw_object_facemap( | void ED_draw_object_facemap( | ||||
| const EvaluationContext *eval_ctx, Scene *scene, Object *ob, const float col[4], const int facemap) | const EvaluationContext *eval_ctx, Scene *scene, Object *ob, const float col[4], const int facemap) | ||||
| { | { | ||||
| DerivedMesh *dm = NULL; | DerivedMesh *dm = NULL; | ||||
| ▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines | |||||