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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-08 16:35:14 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-08 16:35:14 +0400
commitec33687d6cf74775e37fdc1a14e22dea08289cb1 (patch)
treea98875cf3deae05c46cdd70192858b8844ab1ea4 /source/blender/makesrna
parent724746dba2deed8e336fc66b36bfc3b5b1858a8e (diff)
parent7b9adab594d1cc670d642b56ae8d76069ce91107 (diff)
Merged changes in the trunk up to revision 52815.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_access.c14
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c1
-rw-r--r--source/blender/makesrna/intern/rna_scene.c12
-rw-r--r--source/blender/makesrna/intern/rna_space.c7
-rw-r--r--source/blender/makesrna/intern/rna_texture.c31
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c11
7 files changed, 60 insertions, 17 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 0df6fc41269..e22bffd7db7 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -897,6 +897,7 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path,
char *RNA_path_from_ID_to_struct(PointerRNA *ptr);
char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop);
+char *RNA_path_from_ID_python(struct ID *id);
/* Quick name based property access
*
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 470e87daeea..488dbffc3db 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -46,6 +46,7 @@
#include "BKE_animsys.h"
#include "BKE_context.h"
+#include "BKE_idcode.h"
#include "BKE_idprop.h"
#include "BKE_main.h"
#include "BKE_report.h"
@@ -4163,6 +4164,19 @@ char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop)
return path;
}
+/**
+ * Get the ID as a python representation, eg:
+ * bpy.data.foo["bar"]
+ */
+char *RNA_path_from_ID_python(ID *id)
+{
+ char id_esc[(sizeof(id->name) - 2) * 2];
+
+ BLI_strescape(id_esc, id->name + 2, sizeof(id_esc));
+
+ return BLI_sprintfN("bpy.data.%s[\"%s\"]", BKE_idcode_to_name_plural(GS(id->name)), id_esc);
+}
+
/* Quick name based property access */
int RNA_boolean_get(PointerRNA *ptr, const char *name)
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 06df6c5afbc..a2b0945fb46 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -2207,6 +2207,7 @@ static void rna_def_modifier_smoke(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_smoke_type_items);
RNA_def_property_ui_text(prop, "Type", "");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Smoke_set_type");
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index ffcca772764..6527fe29263 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -146,6 +146,11 @@ EnumPropertyItem snap_node_element_items[] = {
{0, NULL, 0, NULL, NULL}
};
+EnumPropertyItem snap_uv_element_items[] = {
+ {SCE_SNAP_MODE_INCREMENT, "INCREMENT", ICON_SNAP_INCREMENT, "Increment", "Snap to increments of grid"},
+ {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"},
+ {0, NULL, 0, NULL, NULL}
+};
/* workaround for duplicate enums,
* have each enum line as a defne then conditionally set it or not
@@ -1689,6 +1694,13 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_enum_items(prop, snap_node_element_items);
RNA_def_property_ui_text(prop, "Snap Node Element", "Type of element to snap to");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
+
+ /* image editor uses own set of snap modes */
+ prop = RNA_def_property(srna, "snap_uv_element", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "snap_uv_mode");
+ RNA_def_property_enum_items(prop, snap_uv_element_items);
+ RNA_def_property_ui_text(prop, "Snap UV Element", "Type of element to snap to");
+ RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
prop = RNA_def_property(srna, "snap_target", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "snap_target");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 2aa907b72f2..c928e91ea1f 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2977,10 +2977,9 @@ static void rna_def_space_node(BlenderRNA *brna)
{SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
"Draw image with RGB colors and alpha transparency"},
{SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
- /* XXX, we could use better icons here */
- {SNODE_SHOW_R, "RED", ICON_COLOR, "Red", ""},
- {SNODE_SHOW_G, "GREEN", ICON_COLOR, "Green", ""},
- {SNODE_SHOW_B, "BLUE", ICON_COLOR, "Blue", ""},
+ {SNODE_SHOW_R, "RED", ICON_COLOR_RED, "Red", ""},
+ {SNODE_SHOW_G, "GREEN", ICON_COLOR_GREEN, "Green", ""},
+ {SNODE_SHOW_B, "BLUE", ICON_COLOR_BLUE, "Blue", ""},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index b212879512e..bdf9fa4e436 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -264,19 +264,24 @@ char *rna_TextureSlot_path(PointerRNA *ptr)
* may be used multiple times in the same stack
*/
if (ptr->id.data) {
- PointerRNA id_ptr;
- PropertyRNA *prop;
-
- /* find the 'textures' property of the ID-struct */
- RNA_id_pointer_create(ptr->id.data, &id_ptr);
- prop = RNA_struct_find_property(&id_ptr, "texture_slots");
-
- /* get an iterator for this property, and try to find the relevant index */
- if (prop) {
- int index = RNA_property_collection_lookup_index(&id_ptr, prop, ptr);
-
- if (index >= 0)
- return BLI_sprintfN("texture_slots[%d]", index);
+ if (GS(((ID *)ptr->id.data)->name) == ID_BR) {
+ return BLI_strdup("texture_slot");
+ }
+ else {
+ PointerRNA id_ptr;
+ PropertyRNA *prop;
+
+ /* find the 'textures' property of the ID-struct */
+ RNA_id_pointer_create(ptr->id.data, &id_ptr);
+ prop = RNA_struct_find_property(&id_ptr, "texture_slots");
+
+ /* get an iterator for this property, and try to find the relevant index */
+ if (prop) {
+ int index = RNA_property_collection_lookup_index(&id_ptr, prop, ptr);
+
+ if (index >= 0)
+ return BLI_sprintfN("texture_slots[%d]", index);
+ }
}
}
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 50341c84b8f..59a3a8c2522 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -144,6 +144,12 @@ static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA
rna_userdef_update(bmain, scene, ptr);
}
+static void rna_userdef_gl_gpu_mipmaps(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
+ rna_userdef_update(bmain, scene, ptr);
+}
+
static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
GPU_free_images();
@@ -3228,6 +3234,11 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "16 Bit Float Textures", "Use 16 bit per component texture for float images");
RNA_def_property_update(prop, 0, "rna_userdef_gl_use_16bit_textures");
+ prop = RNA_def_property(srna, "use_gpu_mipmap", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "use_gpu_mipmap", 1);
+ RNA_def_property_ui_text(prop, "GPU Mipmap Generation", "Generate Image Mipmaps on the GPU");
+ RNA_def_property_update(prop, 0, "rna_userdef_gl_gpu_mipmaps");
+
prop = RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
RNA_def_property_ui_text(prop, "VBOs",