Fix T83013: Annotation with hidden object in sculpt mode crashes
This just avoids the crash, the annotation tool still doesn't work. Larger changes will be needed to resolve this, see T85532.
This commit is contained in:
@@ -43,9 +43,9 @@ bool ED_sculpt_mask_box_select(struct bContext *C,
|
||||
bool select);
|
||||
|
||||
/* transform */
|
||||
void ED_sculpt_update_modal_transform(struct bContext *C);
|
||||
void ED_sculpt_init_transform(struct bContext *C);
|
||||
void ED_sculpt_end_transform(struct bContext *C);
|
||||
void ED_sculpt_update_modal_transform(struct bContext *C, struct Object *ob);
|
||||
void ED_sculpt_init_transform(struct bContext *C, struct Object *ob);
|
||||
void ED_sculpt_end_transform(struct bContext *C, struct Object *ob);
|
||||
|
||||
/* sculpt_undo.c */
|
||||
void ED_sculpt_undosys_type(struct UndoType *ut);
|
||||
|
||||
@@ -60,10 +60,9 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void ED_sculpt_init_transform(struct bContext *C)
|
||||
void ED_sculpt_init_transform(struct bContext *C, Object *ob)
|
||||
{
|
||||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
|
||||
@@ -220,10 +219,9 @@ static void sculpt_transform_all_vertices(Sculpt *sd, Object *ob)
|
||||
0, ss->filter_cache->totnode, &data, sculpt_transform_task_cb, &settings);
|
||||
}
|
||||
|
||||
void ED_sculpt_update_modal_transform(struct bContext *C)
|
||||
void ED_sculpt_update_modal_transform(struct bContext *C, Object *ob)
|
||||
{
|
||||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
|
||||
|
||||
@@ -243,9 +241,8 @@ void ED_sculpt_update_modal_transform(struct bContext *C)
|
||||
SCULPT_flush_update_step(C, SCULPT_UPDATE_COORDS);
|
||||
}
|
||||
|
||||
void ED_sculpt_end_transform(struct bContext *C)
|
||||
void ED_sculpt_end_transform(struct bContext *C, Object *ob)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
if (ss->filter_cache) {
|
||||
SCULPT_filter_cache_free(ss);
|
||||
|
||||
@@ -1246,7 +1246,7 @@ void createTransData(bContext *C, TransInfo *t)
|
||||
init_prop_edit = false;
|
||||
break;
|
||||
case TC_PARTICLE_VERTS:
|
||||
createTransParticleVerts(C, t);
|
||||
createTransParticleVerts(t);
|
||||
break;
|
||||
case TC_SCULPT:
|
||||
createTransSculpt(C, t);
|
||||
|
||||
@@ -224,7 +224,7 @@ void createTransPaintCurveVerts(bContext *C, TransInfo *t);
|
||||
void flushTransPaintCurve(TransInfo *t);
|
||||
|
||||
/* transform_convert_particle.c */
|
||||
void createTransParticleVerts(bContext *C, TransInfo *t);
|
||||
void createTransParticleVerts(TransInfo *t);
|
||||
void recalcData_particles(TransInfo *t);
|
||||
|
||||
/* transform_convert_sculpt.c */
|
||||
|
||||
@@ -688,7 +688,7 @@ void createTransGPencil(bContext *C, TransInfo *t)
|
||||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
const Scene *scene = CTX_data_scene(C);
|
||||
ToolSettings *ts = scene->toolsettings;
|
||||
Object *obact = CTX_data_active_object(C);
|
||||
Object *obact = OBACT(t->view_layer);
|
||||
bGPdata *gpd = obact->data;
|
||||
BLI_assert(gpd != NULL);
|
||||
|
||||
|
||||
@@ -45,13 +45,13 @@
|
||||
*
|
||||
* \{ */
|
||||
|
||||
void createTransParticleVerts(bContext *C, TransInfo *t)
|
||||
void createTransParticleVerts(TransInfo *t)
|
||||
{
|
||||
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
|
||||
|
||||
TransData *td = NULL;
|
||||
TransDataExtension *tx;
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
Object *ob = OBACT(t->view_layer);
|
||||
ParticleEditSettings *pset = PE_settings(t->scene);
|
||||
PTCacheEdit *edit = PE_get_current(t->depsgraph, t->scene, ob);
|
||||
ParticleSystem *psys = NULL;
|
||||
|
||||
@@ -49,7 +49,7 @@ void createTransSculpt(bContext *C, TransInfo *t)
|
||||
return;
|
||||
}
|
||||
|
||||
Object *ob = CTX_data_active_object(t->context);
|
||||
Object *ob = OBACT(t->view_layer);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
|
||||
{
|
||||
@@ -101,7 +101,7 @@ void createTransSculpt(bContext *C, TransInfo *t)
|
||||
copy_m3_m4(td->axismtx, ob->obmat);
|
||||
|
||||
BLI_assert(!(t->options & CTX_PAINT_CURVE));
|
||||
ED_sculpt_init_transform(C);
|
||||
ED_sculpt_init_transform(C, ob);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
@@ -113,7 +113,8 @@ void createTransSculpt(bContext *C, TransInfo *t)
|
||||
|
||||
void recalcData_sculpt(TransInfo *t)
|
||||
{
|
||||
ED_sculpt_update_modal_transform(t->context);
|
||||
Object *ob = OBACT(t->view_layer);
|
||||
ED_sculpt_update_modal_transform(t->context, ob);
|
||||
}
|
||||
|
||||
void special_aftertrans_update__sculpt(bContext *C, TransInfo *t)
|
||||
@@ -124,8 +125,9 @@ void special_aftertrans_update__sculpt(bContext *C, TransInfo *t)
|
||||
return;
|
||||
}
|
||||
|
||||
Object *ob = OBACT(t->view_layer);
|
||||
BLI_assert(!(t->options & CTX_PAINT_CURVE));
|
||||
ED_sculpt_end_transform(C);
|
||||
ED_sculpt_end_transform(C, ob);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
Reference in New Issue
Block a user