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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-09 03:39:31 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-09 03:39:31 +0400
commitc8cbe63947f6ba05584b5dc6d298dd7301e5dbc0 (patch)
tree6a030c8fb79c0908dc4d94fe3e3cdd5b819faefa /source/blender/makesrna/intern/rna_mesh.c
parentf33080532cbefe3837a5dec0613b1fd803ac072e (diff)
Cycles: fix issues with texture coordinates and object scale. Auto texture
space size and location were outdated often, and already computed on demand by blender internal, now do that through RNA as well.
Diffstat (limited to 'source/blender/makesrna/intern/rna_mesh.c')
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 436b6938e05..733e14857fd 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -452,6 +452,26 @@ static int rna_Mesh_texspace_editable(PointerRNA *ptr)
return (me->texflag & ME_AUTOSPACE)? 0: PROP_EDITABLE;
}
+static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float values[3])
+{
+ Mesh *me= (Mesh*)ptr->data;
+
+ if(!me->bb)
+ BKE_mesh_texspace_calc(me);
+
+ copy_v3_v3(values, me->size);
+}
+
+static void rna_Mesh_texspace_loc_get(PointerRNA *ptr, float values[3])
+{
+ Mesh *me= (Mesh*)ptr->data;
+
+ if(!me->bb)
+ BKE_mesh_texspace_calc(me);
+
+ copy_v3_v3(values, me->loc);
+}
+
static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Mesh *me = rna_mesh(ptr);
@@ -2066,12 +2086,14 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable)
prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "loc");
RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location");
+ RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_loc_get", NULL, NULL);
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop = RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size");
+ RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_size_get", NULL, NULL);
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");