Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_view.c
| Show First 20 Lines • Show All 988 Lines • ▼ Show 20 Lines | |||||
| static void view3d_select_loop(ViewContext *vc, Scene *scene, View3D *v3d, ARegion *ar, bool use_obedit_skip) | static void view3d_select_loop(ViewContext *vc, Scene *scene, View3D *v3d, ARegion *ar, bool use_obedit_skip) | ||||
| { | { | ||||
| short code = 1; | short code = 1; | ||||
| char dt; | char dt; | ||||
| short dtx; | short dtx; | ||||
| if (vc->obedit && vc->obedit->type == OB_MBALL) { | if (vc->obedit && vc->obedit->type == OB_MBALL) { | ||||
| draw_object(scene, ar, v3d, BASACT, DRAW_PICKING | DRAW_CONSTCOLOR); | draw_object(scene, ar, v3d, BASACT, DRAW_PICKING | DRAW_CONSTCOLOR, NULL); | ||||
| } | } | ||||
| else if ((vc->obedit && vc->obedit->type == OB_ARMATURE)) { | else if ((vc->obedit && vc->obedit->type == OB_ARMATURE)) { | ||||
| /* if not drawing sketch, draw bones */ | /* if not drawing sketch, draw bones */ | ||||
| if (!BDR_drawSketchNames(vc)) { | if (!BDR_drawSketchNames(vc)) { | ||||
| draw_object(scene, ar, v3d, BASACT, DRAW_PICKING | DRAW_CONSTCOLOR); | draw_object(scene, ar, v3d, BASACT, DRAW_PICKING | DRAW_CONSTCOLOR, NULL); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| Base *base; | Base *base; | ||||
| v3d->xray = true; /* otherwise it postpones drawing */ | v3d->xray = true; /* otherwise it postpones drawing */ | ||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| if (base->lay & v3d->lay) { | if (base->lay & v3d->lay) { | ||||
| if ((base->object->restrictflag & OB_RESTRICT_SELECT) || | if ((base->object->restrictflag & OB_RESTRICT_SELECT) || | ||||
| (use_obedit_skip && (scene->obedit->data == base->object->data))) | (use_obedit_skip && (scene->obedit->data == base->object->data))) | ||||
| { | { | ||||
| base->selcol = 0; | base->selcol = 0; | ||||
| } | } | ||||
| else { | else { | ||||
| base->selcol = code; | base->selcol = code; | ||||
| if (GPU_select_load_id(code)) { | if (GPU_select_load_id(code)) { | ||||
| draw_object(scene, ar, v3d, base, DRAW_PICKING | DRAW_CONSTCOLOR); | draw_object(scene, ar, v3d, base, DRAW_PICKING | DRAW_CONSTCOLOR, NULL); | ||||
| /* we draw duplicators for selection too */ | /* we draw duplicators for selection too */ | ||||
| if ((base->object->transflag & OB_DUPLI)) { | if ((base->object->transflag & OB_DUPLI)) { | ||||
| ListBase *lb; | ListBase *lb; | ||||
| DupliObject *dob; | DupliObject *dob; | ||||
| Base tbase; | Base tbase; | ||||
| tbase.flag = OB_FROMDUPLI; | tbase.flag = OB_FROMDUPLI; | ||||
| lb = object_duplilist(G.main->eval_ctx, scene, base->object); | lb = object_duplilist(G.main->eval_ctx, scene, base->object); | ||||
| for (dob = lb->first; dob; dob = dob->next) { | for (dob = lb->first; dob; dob = dob->next) { | ||||
| float omat[4][4]; | float omat[4][4]; | ||||
| tbase.object = dob->ob; | tbase.object = dob->ob; | ||||
| copy_m4_m4(omat, dob->ob->obmat); | copy_m4_m4(omat, dob->ob->obmat); | ||||
| copy_m4_m4(dob->ob->obmat, dob->mat); | copy_m4_m4(dob->ob->obmat, dob->mat); | ||||
| /* extra service: draw the duplicator in drawtype of parent */ | /* extra service: draw the duplicator in drawtype of parent */ | ||||
| /* MIN2 for the drawtype to allow bounding box objects in groups for lods */ | /* MIN2 for the drawtype to allow bounding box objects in groups for lods */ | ||||
| dt = tbase.object->dt; tbase.object->dt = MIN2(tbase.object->dt, base->object->dt); | dt = tbase.object->dt; tbase.object->dt = MIN2(tbase.object->dt, base->object->dt); | ||||
| dtx = tbase.object->dtx; tbase.object->dtx = base->object->dtx; | dtx = tbase.object->dtx; tbase.object->dtx = base->object->dtx; | ||||
| draw_object(scene, ar, v3d, &tbase, DRAW_PICKING | DRAW_CONSTCOLOR); | draw_object(scene, ar, v3d, &tbase, DRAW_PICKING | DRAW_CONSTCOLOR, NULL); | ||||
| tbase.object->dt = dt; | tbase.object->dt = dt; | ||||
| tbase.object->dtx = dtx; | tbase.object->dtx = dtx; | ||||
| copy_m4_m4(dob->ob->obmat, omat); | copy_m4_m4(dob->ob->obmat, omat); | ||||
| } | } | ||||
| free_object_duplilist(lb); | free_object_duplilist(lb); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 813 Lines • Show Last 20 Lines | |||||