Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/modes/object_mode.c
| Show First 20 Lines • Show All 1,083 Lines • ▼ Show 20 Lines | static void OBJECT_cache_init(void *vedata) | ||||
| { | { | ||||
| /* Empty/Background Image Pass */ | /* Empty/Background Image Pass */ | ||||
| psl->reference_image = DRW_pass_create( | psl->reference_image = DRW_pass_create( | ||||
| "Refrence Image Pass", | "Refrence Image Pass", | ||||
| DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND); | DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_BLEND); | ||||
| } | } | ||||
| } | } | ||||
| static void DRW_shgroup_mball_helpers(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer) | static void DRW_shgroup_mball_helpers(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer) | ||||
| { | { | ||||
| MetaBall *mb = ob->data; | MetaBall *mb = ob->data; | ||||
| float *color; | float *color; | ||||
| DRW_object_wire_theme_get(ob, scene_layer, &color); | DRW_object_wire_theme_get(ob, view_layer, &color); | ||||
| for (MetaElem *ml = mb->elems.first; ml != NULL; ml = ml->next) { | for (MetaElem *ml = mb->elems.first; ml != NULL; ml = ml->next) { | ||||
| /* draw radius */ | /* draw radius */ | ||||
| BKE_mball_element_calc_display_m3x4(ml->draw_scale_xform, ob->obmat, &ml->x); | BKE_mball_element_calc_display_m3x4(ml->draw_scale_xform, ob->obmat, &ml->x); | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->mball_circle, ml->draw_scale_xform, &ml->rad, color); | DRW_shgroup_call_dynamic_add(stl->g_data->mball_circle, ml->draw_scale_xform, &ml->rad, color); | ||||
| } | } | ||||
| } | } | ||||
| static void DRW_shgroup_lamp(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer) | static void DRW_shgroup_lamp(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer) | ||||
| { | { | ||||
| Lamp *la = ob->data; | Lamp *la = ob->data; | ||||
| float *color; | float *color; | ||||
| int theme_id = DRW_object_wire_theme_get(ob, scene_layer, &color); | int theme_id = DRW_object_wire_theme_get(ob, view_layer, &color); | ||||
| static float zero = 0.0f; | static float zero = 0.0f; | ||||
| float **la_mats = (float **)DRW_object_engine_data_get(ob, &draw_engine_object_type, NULL); | float **la_mats = (float **)DRW_object_engine_data_get(ob, &draw_engine_object_type, NULL); | ||||
| if (*la_mats == NULL) { | if (*la_mats == NULL) { | ||||
| /* we need 2 matrices */ | /* we need 2 matrices */ | ||||
| *la_mats = MEM_mallocN(sizeof(float) * 16 * 2, "Lamp Object Mode Matrices"); | *la_mats = MEM_mallocN(sizeof(float) * 16 * 2, "Lamp Object Mode Matrices"); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | else if (la->type == LA_AREA) { | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->lamp_area, color, &la->area_size, shapemat); | DRW_shgroup_call_dynamic_add(stl->g_data->lamp_area, color, &la->area_size, shapemat); | ||||
| } | } | ||||
| /* Line and point going to the ground */ | /* Line and point going to the ground */ | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->lamp_groundline, ob->obmat[3]); | DRW_shgroup_call_dynamic_add(stl->g_data->lamp_groundline, ob->obmat[3]); | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->lamp_groundpoint, ob->obmat[3]); | DRW_shgroup_call_dynamic_add(stl->g_data->lamp_groundpoint, ob->obmat[3]); | ||||
| } | } | ||||
| static void DRW_shgroup_camera(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer) | static void DRW_shgroup_camera(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer) | ||||
| { | { | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| View3D *v3d = draw_ctx->v3d; | View3D *v3d = draw_ctx->v3d; | ||||
| Scene *scene = draw_ctx->scene; | Scene *scene = draw_ctx->scene; | ||||
| Camera *cam = ob->data; | Camera *cam = ob->data; | ||||
| const bool is_active = (ob == v3d->camera); | const bool is_active = (ob == v3d->camera); | ||||
| float *color; | float *color; | ||||
| DRW_object_wire_theme_get(ob, scene_layer, &color); | DRW_object_wire_theme_get(ob, view_layer, &color); | ||||
| float vec[4][3], asp[2], shift[2], scale[3], drawsize; | float vec[4][3], asp[2], shift[2], scale[3], drawsize; | ||||
| scale[0] = 1.0f / len_v3(ob->obmat[0]); | scale[0] = 1.0f / len_v3(ob->obmat[0]); | ||||
| scale[1] = 1.0f / len_v3(ob->obmat[1]); | scale[1] = 1.0f / len_v3(ob->obmat[1]); | ||||
| scale[2] = 1.0f / len_v3(ob->obmat[2]); | scale[2] = 1.0f / len_v3(ob->obmat[2]); | ||||
| BKE_camera_view_frame_ex(scene, cam, cam->drawsize, false, scale, | BKE_camera_view_frame_ex(scene, cam, cam->drawsize, false, scale, | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | if (world) { | ||||
| &world->miststa, &world->mistend, cam->drwnormalmat); | &world->miststa, &world->mistend, cam->drwnormalmat); | ||||
| DRW_shgroup_call_dynamic_add( | DRW_shgroup_call_dynamic_add( | ||||
| stl->g_data->camera_mist_points, (is_active ? col_hi : col), | stl->g_data->camera_mist_points, (is_active ? col_hi : col), | ||||
| &world->miststa, &world->mistend, cam->drwnormalmat); | &world->miststa, &world->mistend, cam->drwnormalmat); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void DRW_shgroup_empty(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, SceneLayer *scene_layer) | static void DRW_shgroup_empty(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, ViewLayer *view_layer) | ||||
| { | { | ||||
| float *color; | float *color; | ||||
| DRW_object_wire_theme_get(ob, scene_layer, &color); | DRW_object_wire_theme_get(ob, view_layer, &color); | ||||
| switch (ob->empty_drawtype) { | switch (ob->empty_drawtype) { | ||||
| case OB_PLAINAXES: | case OB_PLAINAXES: | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->plain_axes, color, &ob->empty_drawsize, ob->obmat); | DRW_shgroup_call_dynamic_add(stl->g_data->plain_axes, color, &ob->empty_drawsize, ob->obmat); | ||||
| break; | break; | ||||
| case OB_SINGLE_ARROW: | case OB_SINGLE_ARROW: | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->single_arrow, color, &ob->empty_drawsize, ob->obmat); | DRW_shgroup_call_dynamic_add(stl->g_data->single_arrow, color, &ob->empty_drawsize, ob->obmat); | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->single_arrow_line, color, &ob->empty_drawsize, ob->obmat); | DRW_shgroup_call_dynamic_add(stl->g_data->single_arrow_line, color, &ob->empty_drawsize, ob->obmat); | ||||
| Show All 15 Lines | case OB_ARROWS: | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->axis_names, color, &ob->empty_drawsize, ob->obmat); | DRW_shgroup_call_dynamic_add(stl->g_data->axis_names, color, &ob->empty_drawsize, ob->obmat); | ||||
| break; | break; | ||||
| case OB_EMPTY_IMAGE: | case OB_EMPTY_IMAGE: | ||||
| DRW_shgroup_empty_image(stl, psl, ob, color); | DRW_shgroup_empty_image(stl, psl, ob, color); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static void DRW_shgroup_forcefield(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer) | static void DRW_shgroup_forcefield(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer) | ||||
| { | { | ||||
| int theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); | int theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL); | ||||
| float *color = DRW_color_background_blend_get(theme_id); | float *color = DRW_color_background_blend_get(theme_id); | ||||
| PartDeflect *pd = ob->pd; | PartDeflect *pd = ob->pd; | ||||
| Curve *cu = (ob->type == OB_CURVE) ? ob->data : NULL; | Curve *cu = (ob->type == OB_CURVE) ? ob->data : NULL; | ||||
| /* TODO Move this to depsgraph */ | /* TODO Move this to depsgraph */ | ||||
| float tmp[3]; | float tmp[3]; | ||||
| copy_v3_fl(pd->drawvec1, ob->empty_drawsize); | copy_v3_fl(pd->drawvec1, ob->empty_drawsize); | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | else if (pd->falloff == PFIELD_FALL_CONE) { | ||||
| } | } | ||||
| if (pd->flag & (PFIELD_USEMIN | PFIELD_USEMINR)) { | if (pd->flag & (PFIELD_USEMIN | PFIELD_USEMINR)) { | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->field_cone_limit, color, &pd->drawvec_falloff_min, ob->obmat); | DRW_shgroup_call_dynamic_add(stl->g_data->field_cone_limit, color, &pd->drawvec_falloff_min, ob->obmat); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void DRW_shgroup_speaker(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer) | static void DRW_shgroup_speaker(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer) | ||||
| { | { | ||||
| float *color; | float *color; | ||||
| static float one = 1.0f; | static float one = 1.0f; | ||||
| DRW_object_wire_theme_get(ob, scene_layer, &color); | DRW_object_wire_theme_get(ob, view_layer, &color); | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->speaker, color, &one, ob->obmat); | DRW_shgroup_call_dynamic_add(stl->g_data->speaker, color, &one, ob->obmat); | ||||
| } | } | ||||
| typedef struct OBJECT_LightProbeEngineData { | typedef struct OBJECT_LightProbeEngineData { | ||||
| float prb_mats[6][4][4]; | float prb_mats[6][4][4]; | ||||
| float probe_cube_mat[4][4]; | float probe_cube_mat[4][4]; | ||||
| float draw_size; | float draw_size; | ||||
| float increment_x[3]; | float increment_x[3]; | ||||
| float increment_y[3]; | float increment_y[3]; | ||||
| float increment_z[3]; | float increment_z[3]; | ||||
| float corner[3]; | float corner[3]; | ||||
| } OBJECT_LightProbeEngineData; | } OBJECT_LightProbeEngineData; | ||||
| static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, SceneLayer *scene_layer) | static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, ViewLayer *view_layer) | ||||
| { | { | ||||
| float *color; | float *color; | ||||
| static float one = 1.0f; | static float one = 1.0f; | ||||
| LightProbe *prb = (LightProbe *)ob->data; | LightProbe *prb = (LightProbe *)ob->data; | ||||
| bool do_outlines = ((ob->base_flag & BASE_SELECTED) != 0); | bool do_outlines = ((ob->base_flag & BASE_SELECTED) != 0); | ||||
| DRW_object_wire_theme_get(ob, scene_layer, &color); | DRW_object_wire_theme_get(ob, view_layer, &color); | ||||
| OBJECT_LightProbeEngineData *prb_data; | OBJECT_LightProbeEngineData *prb_data; | ||||
| OBJECT_LightProbeEngineData **prb_data_pt = (OBJECT_LightProbeEngineData **)DRW_object_engine_data_get(ob, &draw_engine_object_type, NULL); | OBJECT_LightProbeEngineData **prb_data_pt = (OBJECT_LightProbeEngineData **)DRW_object_engine_data_get(ob, &draw_engine_object_type, NULL); | ||||
| if (*prb_data_pt == NULL) { | if (*prb_data_pt == NULL) { | ||||
| *prb_data_pt = MEM_mallocN(sizeof(OBJECT_LightProbeEngineData), "Probe Clip distances Matrices"); | *prb_data_pt = MEM_mallocN(sizeof(OBJECT_LightProbeEngineData), "Probe Clip distances Matrices"); | ||||
| } | } | ||||
| prb_data = *prb_data_pt; | prb_data = *prb_data_pt; | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob) | static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob) | ||||
| { | { | ||||
| if (ob->parent && BKE_object_is_visible(ob->parent)) { | if (ob->parent && BKE_object_is_visible(ob->parent)) { | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]); | DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]); | ||||
| DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->parent->obmat[3]); | DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->parent->obmat[3]); | ||||
| } | } | ||||
| } | } | ||||
| static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, SceneLayer *scene_layer, View3D *v3d) | static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer, View3D *v3d) | ||||
| { | { | ||||
| const bool is_library = ob->id.us > 1 || ID_IS_LINKED(ob); | const bool is_library = ob->id.us > 1 || ID_IS_LINKED(ob); | ||||
| DRWShadingGroup *shgroup; | DRWShadingGroup *shgroup; | ||||
| if (ob == OBACT(scene_layer)) { | if (ob == OBACT(view_layer)) { | ||||
| shgroup = stl->g_data->center_active; | shgroup = stl->g_data->center_active; | ||||
| } | } | ||||
| else if (ob->base_flag & BASE_SELECTED) { | else if (ob->base_flag & BASE_SELECTED) { | ||||
| if (is_library) { | if (is_library) { | ||||
| shgroup = stl->g_data->center_selected_lib; | shgroup = stl->g_data->center_selected_lib; | ||||
| } | } | ||||
| else { | else { | ||||
| shgroup = stl->g_data->center_selected; | shgroup = stl->g_data->center_selected; | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void OBJECT_cache_populate(void *vedata, Object *ob) | static void OBJECT_cache_populate(void *vedata, Object *ob) | ||||
| { | { | ||||
| OBJECT_PassList *psl = ((OBJECT_Data *)vedata)->psl; | OBJECT_PassList *psl = ((OBJECT_Data *)vedata)->psl; | ||||
| OBJECT_StorageList *stl = ((OBJECT_Data *)vedata)->stl; | OBJECT_StorageList *stl = ((OBJECT_Data *)vedata)->stl; | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| Scene *scene = draw_ctx->scene; | Scene *scene = draw_ctx->scene; | ||||
| SceneLayer *scene_layer = draw_ctx->scene_layer; | ViewLayer *view_layer = draw_ctx->view_layer; | ||||
| View3D *v3d = draw_ctx->v3d; | View3D *v3d = draw_ctx->v3d; | ||||
| int theme_id = TH_UNDEFINED; | int theme_id = TH_UNDEFINED; | ||||
| if (!BKE_object_is_visible(ob)) { | if (!BKE_object_is_visible(ob)) { | ||||
| return; | return; | ||||
| } | } | ||||
| //CollectionEngineSettings *ces_mode_ob = BKE_layer_collection_engine_evaluated_get(ob, COLLECTION_MODE_OBJECT, ""); | //CollectionEngineSettings *ces_mode_ob = BKE_layer_collection_engine_evaluated_get(ob, COLLECTION_MODE_OBJECT, ""); | ||||
| //bool do_wire = BKE_collection_engine_property_value_get_bool(ces_mode_ob, "show_wire"); | //bool do_wire = BKE_collection_engine_property_value_get_bool(ces_mode_ob, "show_wire"); | ||||
| bool do_outlines = ((ob->base_flag & BASE_SELECTED) != 0); | bool do_outlines = ((ob->base_flag & BASE_SELECTED) != 0); | ||||
| if (do_outlines) { | if (do_outlines) { | ||||
| Object *obedit = scene->obedit; | Object *obedit = scene->obedit; | ||||
| if (ob != obedit && !((ob == draw_ctx->obact) && (ob->mode & OB_MODE_ALL_PAINT))) { | if (ob != obedit && !((ob == draw_ctx->obact) && (ob->mode & OB_MODE_ALL_PAINT))) { | ||||
| struct Gwn_Batch *geom = DRW_cache_object_surface_get(ob); | struct Gwn_Batch *geom = DRW_cache_object_surface_get(ob); | ||||
| if (geom) { | if (geom) { | ||||
| theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); | theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL); | ||||
| DRWShadingGroup *shgroup = shgroup_theme_id_to_outline_or(stl, theme_id, NULL); | DRWShadingGroup *shgroup = shgroup_theme_id_to_outline_or(stl, theme_id, NULL); | ||||
| if (shgroup != NULL) { | if (shgroup != NULL) { | ||||
| DRW_shgroup_call_add(shgroup, geom, ob->obmat); | DRW_shgroup_call_add(shgroup, geom, ob->obmat); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| switch (ob->type) { | switch (ob->type) { | ||||
| case OB_MESH: | case OB_MESH: | ||||
| { | { | ||||
| Mesh *me = ob->data; | Mesh *me = ob->data; | ||||
| if (me->totpoly == 0) { | if (me->totpoly == 0) { | ||||
| Object *obedit = scene->obedit; | Object *obedit = scene->obedit; | ||||
| if (ob != obedit) { | if (ob != obedit) { | ||||
| struct Gwn_Batch *geom = DRW_cache_mesh_edges_get(ob); | struct Gwn_Batch *geom = DRW_cache_mesh_edges_get(ob); | ||||
| if (geom) { | if (geom) { | ||||
| if (theme_id == TH_UNDEFINED) { | if (theme_id == TH_UNDEFINED) { | ||||
| theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); | theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL); | ||||
| } | } | ||||
| DRWShadingGroup *shgroup = shgroup_theme_id_to_wire_or(stl, theme_id, stl->g_data->wire); | DRWShadingGroup *shgroup = shgroup_theme_id_to_wire_or(stl, theme_id, stl->g_data->wire); | ||||
| DRW_shgroup_call_add(shgroup, geom, ob->obmat); | DRW_shgroup_call_add(shgroup, geom, ob->obmat); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| OBJECT_cache_populate_particles(ob, psl); | OBJECT_cache_populate_particles(ob, psl); | ||||
| break; | break; | ||||
| } | } | ||||
| case OB_SURF: | case OB_SURF: | ||||
| break; | break; | ||||
| case OB_LATTICE: | case OB_LATTICE: | ||||
| { | { | ||||
| Object *obedit = scene->obedit; | Object *obedit = scene->obedit; | ||||
| if (ob != obedit) { | if (ob != obedit) { | ||||
| struct Gwn_Batch *geom = DRW_cache_lattice_wire_get(ob, false); | struct Gwn_Batch *geom = DRW_cache_lattice_wire_get(ob, false); | ||||
| if (theme_id == TH_UNDEFINED) { | if (theme_id == TH_UNDEFINED) { | ||||
| theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); | theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL); | ||||
| } | } | ||||
| DRWShadingGroup *shgroup = shgroup_theme_id_to_wire_or(stl, theme_id, stl->g_data->wire); | DRWShadingGroup *shgroup = shgroup_theme_id_to_wire_or(stl, theme_id, stl->g_data->wire); | ||||
| DRW_shgroup_call_add(shgroup, geom, ob->obmat); | DRW_shgroup_call_add(shgroup, geom, ob->obmat); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case OB_CURVE: | case OB_CURVE: | ||||
| { | { | ||||
| Object *obedit = scene->obedit; | Object *obedit = scene->obedit; | ||||
| if (ob != obedit) { | if (ob != obedit) { | ||||
| struct Gwn_Batch *geom = DRW_cache_curve_edge_wire_get(ob); | struct Gwn_Batch *geom = DRW_cache_curve_edge_wire_get(ob); | ||||
| if (theme_id == TH_UNDEFINED) { | if (theme_id == TH_UNDEFINED) { | ||||
| theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); | theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL); | ||||
| } | } | ||||
| DRWShadingGroup *shgroup = shgroup_theme_id_to_wire_or(stl, theme_id, stl->g_data->wire); | DRWShadingGroup *shgroup = shgroup_theme_id_to_wire_or(stl, theme_id, stl->g_data->wire); | ||||
| DRW_shgroup_call_add(shgroup, geom, ob->obmat); | DRW_shgroup_call_add(shgroup, geom, ob->obmat); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case OB_MBALL: | case OB_MBALL: | ||||
| { | { | ||||
| Object *obedit = scene->obedit; | Object *obedit = scene->obedit; | ||||
| if (ob != obedit) { | if (ob != obedit) { | ||||
| DRW_shgroup_mball_helpers(stl, ob, scene_layer); | DRW_shgroup_mball_helpers(stl, ob, view_layer); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case OB_LAMP: | case OB_LAMP: | ||||
| DRW_shgroup_lamp(stl, ob, scene_layer); | DRW_shgroup_lamp(stl, ob, view_layer); | ||||
| break; | break; | ||||
| case OB_CAMERA: | case OB_CAMERA: | ||||
| DRW_shgroup_camera(stl, ob, scene_layer); | DRW_shgroup_camera(stl, ob, view_layer); | ||||
| break; | break; | ||||
| case OB_EMPTY: | case OB_EMPTY: | ||||
| DRW_shgroup_empty(stl, psl, ob, scene_layer); | DRW_shgroup_empty(stl, psl, ob, view_layer); | ||||
| break; | break; | ||||
| case OB_SPEAKER: | case OB_SPEAKER: | ||||
| DRW_shgroup_speaker(stl, ob, scene_layer); | DRW_shgroup_speaker(stl, ob, view_layer); | ||||
| break; | break; | ||||
| case OB_LIGHTPROBE: | case OB_LIGHTPROBE: | ||||
| DRW_shgroup_lightprobe(stl, psl, ob, scene_layer); | DRW_shgroup_lightprobe(stl, psl, ob, view_layer); | ||||
| break; | break; | ||||
| case OB_ARMATURE: | case OB_ARMATURE: | ||||
| { | { | ||||
| bArmature *arm = ob->data; | bArmature *arm = ob->data; | ||||
| if (arm->edbo == NULL) { | if (arm->edbo == NULL) { | ||||
| if (DRW_state_is_select() || !DRW_pose_mode_armature(ob, draw_ctx->obact)) { | if (DRW_state_is_select() || !DRW_pose_mode_armature(ob, draw_ctx->obact)) { | ||||
| DRW_shgroup_armature_object( | DRW_shgroup_armature_object( | ||||
| ob, scene_layer, psl->bone_solid, psl->bone_wire, psl->bone_envelope, | ob, view_layer, psl->bone_solid, psl->bone_wire, psl->bone_envelope, | ||||
| stl->g_data->relationship_lines); | stl->g_data->relationship_lines); | ||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| if (ob->pd && ob->pd->forcefield) { | if (ob->pd && ob->pd->forcefield) { | ||||
| DRW_shgroup_forcefield(stl, ob, scene_layer); | DRW_shgroup_forcefield(stl, ob, view_layer); | ||||
| } | } | ||||
| /* don't show object extras in set's */ | /* don't show object extras in set's */ | ||||
| if ((ob->base_flag & (BASE_FROM_SET | BASE_FROMDUPLI)) == 0) { | if ((ob->base_flag & (BASE_FROM_SET | BASE_FROMDUPLI)) == 0) { | ||||
| DRW_shgroup_object_center(stl, ob, scene_layer, v3d); | DRW_shgroup_object_center(stl, ob, view_layer, v3d); | ||||
| DRW_shgroup_relationship_lines(stl, ob); | DRW_shgroup_relationship_lines(stl, ob); | ||||
| if ((ob->dtx & OB_DRAWNAME) && DRW_state_show_text()) { | if ((ob->dtx & OB_DRAWNAME) && DRW_state_show_text()) { | ||||
| struct DRWTextStore *dt = DRW_text_cache_ensure(); | struct DRWTextStore *dt = DRW_text_cache_ensure(); | ||||
| if (theme_id == TH_UNDEFINED) { | if (theme_id == TH_UNDEFINED) { | ||||
| theme_id = DRW_object_wire_theme_get(ob, scene_layer, NULL); | theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL); | ||||
| } | } | ||||
| unsigned char color[4]; | unsigned char color[4]; | ||||
| UI_GetThemeColor4ubv(theme_id, color); | UI_GetThemeColor4ubv(theme_id, color); | ||||
| DRW_text_cache_add( | DRW_text_cache_add( | ||||
| dt, ob->obmat[3], | dt, ob->obmat[3], | ||||
| ob->id.name + 2, strlen(ob->id.name + 2), | ob->id.name + 2, strlen(ob->id.name + 2), | ||||
| ▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines | |||||