svn merge -r38971:38972 https://svn.blender.org/svnroot/bf-blender/trunk/blender, left UVCALC_TRANSFORM_CORRECT as a BMesh TODO

This commit is contained in:
Campbell Barton
2011-08-05 08:16:09 +00:00
4 changed files with 29 additions and 1 deletions

View File

@@ -148,6 +148,7 @@ void BIF_selectOrientation(void);
#define P_ALIGN_SNAP (P_GEO_SNAP|(1 << 5))
#define P_CONSTRAINT (1 << 6)
#define P_OPTIONS (1 << 7)
#define P_CORRECT_UV (1 << 8)
void Transform_Properties(struct wmOperatorType *ot, int flags);

View File

@@ -4609,6 +4609,12 @@ void projectSVData(TransInfo *t, int final)
if (!em)
return;
/* BMESH_TODO, (t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)
* currently all vertex data is interpolated which is nice mostly
* except for shape keys where you dont want to modify UVs for eg.
* current BMesh code doesnt make it easy to pick which data we interpolate
* - campbell */
BLI_smallhash_init(&visit);
for (i=0, tempsv=sld->sv; i<sld->totsv; i++, tempsv++) {

View File

@@ -1015,6 +1015,22 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->options |= CTX_NO_PET;
}
}
/* initialize UV transform from */
if (RNA_struct_find_property(op->ptr, "correct_uv")) {
if(RNA_property_is_set(op->ptr, "correct_uv")) {
if(RNA_boolean_get(op->ptr, "correct_uv")) {
t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT;
}
else {
t->settings->uvcalc_flag &= ~UVCALC_TRANSFORM_CORRECT;
}
}
else {
RNA_boolean_set(op->ptr, "correct_uv", t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT);
}
}
}
else if(t->spacetype==SPACE_IMAGE)
{

View File

@@ -508,6 +508,11 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
RNA_def_boolean(ot->srna, "texture_space", 0, "Edit Object data texture space", "");
}
if (flags & P_CORRECT_UV)
{
RNA_def_boolean(ot->srna, "correct_uv", 0, "Correct UV coords when transforming", "");
}
// Add confirm method all the time. At the end because it's not really that important and should be hidden only in log, not in keymap edit
/*prop =*/ RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button");
//RNA_def_property_flag(prop, PROP_HIDDEN);
@@ -755,7 +760,7 @@ void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
Transform_Properties(ot, P_MIRROR|P_SNAP);
Transform_Properties(ot, P_MIRROR|P_SNAP|P_CORRECT_UV);
}
void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot)