Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-03-26 17:50:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-03-26 17:50:29 +0300
commit5fa576a89f82f3d4d45b9aaf7cc4c388cc6d2d93 (patch)
treef2fd34e455126f98bba91ae41a180d3118b36531 /source/blender/src/parametrizer.c
parent6184c07474f03c2fb815e28264a35881bace12d0 (diff)
UV Unwrap (lscm, project from view, cube etc) now default to correcting for the active images aspect ratio.
This is now default but can be disabled in the UV Calculation panel. At the moment its called "Image Aspect" but another name could be better.
Diffstat (limited to 'source/blender/src/parametrizer.c')
-rw-r--r--source/blender/src/parametrizer.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/src/parametrizer.c b/source/blender/src/parametrizer.c
index c97056956d8..a643f37ec2a 100644
--- a/source/blender/src/parametrizer.c
+++ b/source/blender/src/parametrizer.c
@@ -256,6 +256,16 @@ static void p_chart_uv_scale(PChart *chart, float scale)
}
}
+static void p_chart_uv_scale_xy(PChart *chart, float x, float y)
+{
+ PVert *v;
+
+ for (v=chart->verts; v; v=v->nextlink) {
+ v->uv[0] *= x;
+ v->uv[1] *= y;
+ }
+}
+
static void p_chart_uv_translate(PChart *chart, float trans[2])
{
PVert *v;
@@ -4220,6 +4230,18 @@ void param_average(ParamHandle *handle)
}
}
+void param_scale(ParamHandle *handle, float x, float y)
+{
+ PHandle *phandle = (PHandle*)handle;
+ PChart *chart;
+ int i;
+
+ for (i = 0; i < phandle->ncharts; i++) {
+ chart = phandle->charts[i];
+ p_chart_uv_scale_xy(chart, x, y);
+ }
+}
+
void param_flush(ParamHandle *handle)
{
PHandle *phandle = (PHandle*)handle;