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
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2010-04-12 07:06:49 +0400
committerDalai Felinto <dfelinto@gmail.com>2010-04-12 07:06:49 +0400
commit7135edb75daca55f0ab5e3b601fd73d486c9d060 (patch)
tree84a99cbd70c98b7b686c00aeed79b69ad5df4d8a /source
parent091f70e92d2160f0326ec75ed175fc206b2477b9 (diff)
BGE: TexFace panel (from patch #21780 from Mitchell Stokes + some changes)
the patch exposes a rna property to get the active edit mode face. This is a hack. However it's a small patch (a.k.a. easy to revert later if needed). The official plan is to wait for BMesh before tackling it properly. Nevertheless TexFace panel is really important for BGE. Missing: operators to copy the current parameters to other selected faces. * note: what I changed from the original patch is the UI script. The pool wasn't defined and it was using tabs.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c24
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c2
2 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index ce8001c8ecd..0c137504fe0 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -46,6 +46,8 @@
#include "BKE_mesh.h"
#include "BKE_utildefines.h"
+#include "ED_mesh.h" /* XXX Bad level call */
+
#include "WM_api.h"
#include "WM_types.h"
@@ -458,6 +460,22 @@ static void rna_Mesh_active_uv_texture_index_range(PointerRNA *ptr, int *min, in
*max= MAX2(0, *max);
}
+static PointerRNA rna_Mesh_active_mtface_get(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->data;
+ EditMesh *em= BKE_mesh_get_editmesh(me);
+ MTFace *tf;
+
+ if (em && EM_texFaceCheck(em))
+ {
+ tf = EM_get_active_mtface(em, NULL, NULL, 1);
+
+ return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFace, tf);
+ }
+
+ return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFace, NULL);
+}
+
static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values)
{
MTFace *mtface= (MTFace*)ptr->data;
@@ -1599,6 +1617,12 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop)
prop= RNA_def_property(srna, "active", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "act_face");
RNA_def_property_ui_text(prop, "Active Face", "The active face for this mesh");
+
+ prop= RNA_def_property(srna, "active_tface", PROP_POINTER, PROP_UNSIGNED);
+ RNA_def_property_struct_type(prop, "MeshTextureFace");
+ RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_mtface_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Active Texture Face", "Active Texture Face");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 86d32118872..be04875ef8f 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -248,6 +248,8 @@ float ED_rollBoneToVector(struct EditBone *bone, float new_up_axis[3]){return 0.
void ED_space_image_size(struct SpaceImage *sima, int *width, int *height){}
void EM_selectmode_set(struct EditMesh *em){}
+int EM_texFaceCheck(struct EditMesh *em){return 0;}
+struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_efa, struct MCol **mcol, int sloopy){return (struct MTFace *)NULL;}
void make_editMesh(struct Scene *scene, struct Object *ob){}
void load_editMesh(struct Scene *scene, struct Object *ob){}