Cleanup: remove unimplemented texture space rotation variables

This commit is contained in:
2019-09-23 15:54:21 +02:00
parent 9208146199
commit 69ad44d5b4
16 changed files with 27 additions and 74 deletions

View File

@@ -89,7 +89,7 @@ struct BoundBox *BKE_curve_boundbox_get(struct Object *ob);
void BKE_curve_texspace_calc(struct Curve *cu);
void BKE_curve_texspace_ensure(struct Curve *cu);
void BKE_curve_texspace_get(struct Curve *cu, float r_loc[3], float r_rot[3], float r_size[3]);
void BKE_curve_texspace_get(struct Curve *cu, float r_loc[3], float r_size[3]);
bool BKE_curve_minmax(struct Curve *cu, bool use_radius, float min[3], float max[3]);
bool BKE_curve_center_median(struct Curve *cu, float cent[3]);

View File

@@ -193,9 +193,11 @@ struct BoundBox *BKE_mesh_boundbox_get(struct Object *ob);
void BKE_mesh_texspace_calc(struct Mesh *me);
void BKE_mesh_texspace_ensure(struct Mesh *me);
void BKE_mesh_texspace_get(struct Mesh *me, float r_loc[3], float r_rot[3], float r_size[3]);
void BKE_mesh_texspace_get_reference(
struct Mesh *me, short **r_texflag, float **r_loc, float **r_rot, float **r_size);
void BKE_mesh_texspace_get(struct Mesh *me, float r_loc[3], float r_size[3]);
void BKE_mesh_texspace_get_reference(struct Mesh *me,
short **r_texflag,
float **r_loc,
float **r_size);
void BKE_mesh_texspace_copy_from_object(struct Mesh *me, struct Object *ob);
void BKE_mesh_split_faces(struct Mesh *mesh, bool free_loop_normals);

View File

@@ -321,8 +321,10 @@ void BKE_object_handle_update_ex(struct Depsgraph *depsgraph,
void BKE_object_sculpt_data_create(struct Object *ob);
int BKE_object_obdata_texspace_get(
struct Object *ob, short **r_texflag, float **r_loc, float **r_size, float **r_rot);
int BKE_object_obdata_texspace_get(struct Object *ob,
short **r_texflag,
float **r_loc,
float **r_size);
struct Mesh *BKE_object_get_evaluated_mesh(const struct Depsgraph *depsgraph, struct Object *ob);
struct Mesh *BKE_object_get_final_mesh(struct Object *object);

View File

@@ -340,7 +340,6 @@ void BKE_curve_texspace_calc(Curve *cu)
copy_v3_v3(cu->loc, loc);
copy_v3_v3(cu->size, size);
zero_v3(cu->rot);
cu->texflag |= CU_AUTOSPACE_EVALUATED;
}
@@ -353,16 +352,13 @@ void BKE_curve_texspace_ensure(Curve *cu)
}
}
void BKE_curve_texspace_get(Curve *cu, float r_loc[3], float r_rot[3], float r_size[3])
void BKE_curve_texspace_get(Curve *cu, float r_loc[3], float r_size[3])
{
BKE_curve_texspace_ensure(cu);
if (r_loc) {
copy_v3_v3(r_loc, cu->loc);
}
if (r_rot) {
copy_v3_v3(r_rot, cu->rot);
}
if (r_size) {
copy_v3_v3(r_size, cu->size);
}
@@ -5481,7 +5477,6 @@ void BKE_curve_eval_geometry(Depsgraph *depsgraph, Curve *curve)
curve_orig->texflag |= CU_AUTOSPACE_EVALUATED;
copy_v3_v3(curve_orig->loc, curve->loc);
copy_v3_v3(curve_orig->size, curve->size);
copy_v3_v3(curve_orig->rot, curve->rot);
}
}
}

View File

@@ -865,7 +865,6 @@ void BKE_mesh_texspace_calc(Mesh *me)
copy_v3_v3(me->loc, loc);
copy_v3_v3(me->size, size);
zero_v3(me->rot);
me->texflag |= ME_AUTOSPACE_EVALUATED;
}
@@ -878,23 +877,19 @@ void BKE_mesh_texspace_ensure(Mesh *me)
}
}
void BKE_mesh_texspace_get(Mesh *me, float r_loc[3], float r_rot[3], float r_size[3])
void BKE_mesh_texspace_get(Mesh *me, float r_loc[3], float r_size[3])
{
BKE_mesh_texspace_ensure(me);
if (r_loc) {
copy_v3_v3(r_loc, me->loc);
}
if (r_rot) {
copy_v3_v3(r_rot, me->rot);
}
if (r_size) {
copy_v3_v3(r_size, me->size);
}
}
void BKE_mesh_texspace_get_reference(
Mesh *me, short **r_texflag, float **r_loc, float **r_rot, float **r_size)
void BKE_mesh_texspace_get_reference(Mesh *me, short **r_texflag, float **r_loc, float **r_size)
{
BKE_mesh_texspace_ensure(me);
@@ -904,9 +899,6 @@ void BKE_mesh_texspace_get_reference(
if (r_loc != NULL) {
*r_loc = me->loc;
}
if (r_rot != NULL) {
*r_rot = me->rot;
}
if (r_size != NULL) {
*r_size = me->size;
}
@@ -914,14 +906,13 @@ void BKE_mesh_texspace_get_reference(
void BKE_mesh_texspace_copy_from_object(Mesh *me, Object *ob)
{
float *texloc, *texrot, *texsize;
float *texloc, *texsize;
short *texflag;
if (BKE_object_obdata_texspace_get(ob, &texflag, &texloc, &texsize, &texrot)) {
if (BKE_object_obdata_texspace_get(ob, &texflag, &texloc, &texsize)) {
me->texflag = *texflag;
copy_v3_v3(me->loc, texloc);
copy_v3_v3(me->size, texsize);
copy_v3_v3(me->rot, texrot);
}
}
@@ -950,7 +941,7 @@ void BKE_mesh_orco_verts_transform(Mesh *me, float (*orco)[3], int totvert, int
float loc[3], size[3];
int a;
BKE_mesh_texspace_get(me->texcomesh ? me->texcomesh : me, loc, NULL, size);
BKE_mesh_texspace_get(me->texcomesh ? me->texcomesh : me, loc, size);
if (invert) {
for (a = 0; a < totvert; a++) {
@@ -1942,7 +1933,6 @@ void BKE_mesh_eval_geometry(Depsgraph *depsgraph, Mesh *mesh)
mesh_orig->texflag |= ME_AUTOSPACE_EVALUATED;
copy_v3_v3(mesh_orig->loc, mesh->loc);
copy_v3_v3(mesh_orig->size, mesh->size);
copy_v3_v3(mesh_orig->rot, mesh->rot);
}
}
}

View File

@@ -667,7 +667,6 @@ void BKE_mesh_from_nurbs_displist(Main *bmain,
me->texflag = cu->texflag & ~CU_AUTOSPACE;
copy_v3_v3(me->loc, cu->loc);
copy_v3_v3(me->size, cu->size);
copy_v3_v3(me->rot, cu->rot);
BKE_mesh_texspace_calc(me);
cu->mat = NULL;

View File

@@ -3269,8 +3269,7 @@ void BKE_object_sculpt_data_create(Object *ob)
ob->sculpt->mode_type = ob->mode;
}
int BKE_object_obdata_texspace_get(
Object *ob, short **r_texflag, float **r_loc, float **r_size, float **r_rot)
int BKE_object_obdata_texspace_get(Object *ob, short **r_texflag, float **r_loc, float **r_size)
{
if (ob->data == NULL) {
@@ -3279,7 +3278,7 @@ int BKE_object_obdata_texspace_get(
switch (GS(((ID *)ob->data)->name)) {
case ID_ME: {
BKE_mesh_texspace_get_reference((Mesh *)ob->data, r_texflag, r_loc, r_rot, r_size);
BKE_mesh_texspace_get_reference((Mesh *)ob->data, r_texflag, r_loc, r_size);
break;
}
case ID_CU: {
@@ -3294,9 +3293,6 @@ int BKE_object_obdata_texspace_get(
if (r_size) {
*r_size = cu->size;
}
if (r_rot) {
*r_rot = cu->rot;
}
break;
}
case ID_MB: {
@@ -3310,9 +3306,6 @@ int BKE_object_obdata_texspace_get(
if (r_size) {
*r_size = mb->size;
}
if (r_rot) {
*r_rot = mb->rot;
}
break;
}
default:

View File

@@ -413,7 +413,7 @@ void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata,
DRWShadingGroup *grp = DRW_shgroup_material_create(mat, vedata->psl->volumetric_objects_ps);
BKE_mesh_texspace_get_reference((struct Mesh *)ob->data, NULL, &texcoloc, NULL, &texcosize);
BKE_mesh_texspace_get_reference((struct Mesh *)ob->data, NULL, &texcoloc, &texcosize);
/* TODO(fclem) remove those "unnecessary" UBOs */
DRW_shgroup_uniform_block(grp, "planar_block", sldata->planar_ubo);

View File

@@ -447,7 +447,7 @@ static void drw_call_calc_orco(Object *ob, float (*r_orcofacs)[4])
if (ob_data != NULL) {
switch (GS(ob_data->name)) {
case ID_ME:
BKE_mesh_texspace_get_reference((Mesh *)ob_data, NULL, &texcoloc, NULL, &texcosize);
BKE_mesh_texspace_get_reference((Mesh *)ob_data, NULL, &texcoloc, &texcosize);
break;
case ID_CU: {
Curve *cu = (Curve *)ob_data;

View File

@@ -3019,7 +3019,7 @@ static void DRW_shgroup_texture_space(OBJECT_ShadingGroupList *sgl, Object *ob,
switch (GS(ob_data->name)) {
case ID_ME:
BKE_mesh_texspace_get_reference((Mesh *)ob_data, NULL, &texcoloc, NULL, &texcosize);
BKE_mesh_texspace_get_reference((Mesh *)ob_data, NULL, &texcoloc, &texcosize);
break;
case ID_CU: {
Curve *cu = (Curve *)ob_data;

View File

@@ -7136,7 +7136,6 @@ static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op))
copy_v3_v3(curve->loc, loc);
copy_v3_v3(curve->size, size);
zero_v3(curve->rot);
curve->texflag &= ~CU_AUTOSPACE;

View File

@@ -930,11 +930,13 @@ void createTransTexspace(TransInfo *t)
normalize_m3(td->axismtx);
pseudoinverse_m3_m3(td->smtx, td->mtx, PSEUDOINVERSE_EPSILON);
if (BKE_object_obdata_texspace_get(ob, &texflag, &td->loc, &td->ext->size, &td->ext->rot)) {
if (BKE_object_obdata_texspace_get(ob, &texflag, &td->loc, &td->ext->size)) {
ob->dtx |= OB_TEXSPACE;
*texflag &= ~ME_AUTOSPACE;
}
zero_v3(td->ext->rot);
copy_v3_v3(td->iloc, td->loc);
copy_v3_v3(td->ext->irot, td->ext->rot);
copy_v3_v3(td->ext->isize, td->ext->size);

View File

@@ -227,14 +227,13 @@ typedef struct Curve {
/* texture space, copied as one block in editobject.c */
float loc[3];
float size[3];
float rot[3];
/** Creation-time type of curve datablock. */
short type;
/** Keep a short because of BKE_object_obdata_texspace_get(). */
short texflag;
char _pad0[2];
char _pad0[6];
short twist_mode;
float twist_smooth, smallcaps_scale;

View File

@@ -175,7 +175,6 @@ typedef struct Mesh {
/* texture space, copied as one block in editobject.c */
float loc[3];
float size[3];
float rot[3];
short texflag, flag;
float smoothresh;
@@ -192,7 +191,7 @@ typedef struct Mesh {
float remesh_voxel_size;
char remesh_mode;
char _pad1[3];
char _pad1[7];
/** Deprecated multiresolution modeling data, only keep for loading old files. */
struct Multires *mr DNA_DEPRECATED;

View File

@@ -1757,15 +1757,6 @@ static void rna_def_curve(BlenderRNA *brna)
prop, "rna_Curve_texspace_size_get", "rna_Curve_texspace_size_set", NULL);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* not supported yet */
# if 0
prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
# endif
prop = RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
RNA_def_property_ui_text(

View File

@@ -543,7 +543,7 @@ static void rna_MeshVertex_undeformed_co_get(PointerRNA *ptr, float values[3])
/* orco is normalized to 0..1, we do inverse to match mvert->co */
float loc[3], size[3];
BKE_mesh_texspace_get(me->texcomesh ? me->texcomesh : me, loc, NULL, size);
BKE_mesh_texspace_get(me->texcomesh ? me->texcomesh : me, loc, size);
madd_v3_v3v3v3(values, loc, orco[(mvert - me->mvert)], size);
}
else {
@@ -2207,15 +2207,6 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
/* not supported yet */
# if 0
prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
# endif
/* materials */
prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
@@ -3080,15 +3071,6 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
# endif
/* not supported yet */
# if 0
prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER);
RNA_def_property_float(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation");
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
# endif
/* editflag */
prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);