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>2011-06-01 20:17:38 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-06-01 20:17:38 +0400
commit81982140b862c07dc1a7ddc2ce995339b1eb4547 (patch)
treedf361af193a805db8a1898cdb68264693bdfe9ba /source/blender/makesrna/intern
parentf50fb549dbee9d5ca1aea8a9f07313f2c8cde7f4 (diff)
Fix #27550: texture node editor header was still showing texture datablock
selector even if there is no active texture slot or node, now it's disabled in that case.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_internal.h2
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c2
-rw-r--r--source/blender/makesrna/intern/rna_material.c16
-rw-r--r--source/blender/makesrna/intern/rna_particle.c2
-rw-r--r--source/blender/makesrna/intern/rna_world.c2
5 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index a9fb545ec3f..9175806e2bb 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -187,7 +187,7 @@ void rna_def_animviz_common(struct StructRNA *srna);
void rna_def_motionpath_common(struct StructRNA *srna);
void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
-void rna_def_mtex_common(struct BlenderRNA *brna, struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *structname_slots, const char *update);
+void rna_def_mtex_common(struct BlenderRNA *brna, struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *activeeditable, const char *structname, const char *structname_slots, const char *update);
void rna_def_render_layer_common(struct StructRNA *srna, int scene);
void rna_ID_name_get(struct PointerRNA *ptr, char *value);
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index d16e06812af..f18308591db 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -374,7 +374,7 @@ static void rna_def_lamp(BlenderRNA *brna)
/* textures */
rna_def_mtex_common(brna, srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get",
- "rna_Lamp_active_texture_set", "LampTextureSlot", "LampTextureSlots", "rna_Lamp_update");
+ "rna_Lamp_active_texture_set", NULL, "LampTextureSlot", "LampTextureSlots", "rna_Lamp_update");
}
static void rna_def_lamp_falloff(StructRNA *srna)
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 8c3be7290f4..b86a91967a6 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -170,6 +170,13 @@ static void rna_Material_active_texture_set(PointerRNA *ptr, PointerRNA value)
set_current_material_texture(ma, value.data);
}
+static int rna_Material_active_texture_editable(PointerRNA *ptr)
+{
+ Material *ma= (Material*)ptr->id.data;
+
+ return has_current_material_texture(ma);
+}
+
static PointerRNA rna_Material_active_node_material_get(PointerRNA *ptr)
{
Material *ma= give_node_material((Material*)ptr->data);
@@ -1841,7 +1848,8 @@ void RNA_def_material(BlenderRNA *brna)
/* common */
rna_def_animdata_common(srna);
rna_def_mtex_common(brna, srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get",
- "rna_Material_active_texture_set", "MaterialTextureSlot", "MaterialTextureSlots", "rna_Material_update");
+ "rna_Material_active_texture_set", "rna_Material_active_texture_editable",
+ "MaterialTextureSlot", "MaterialTextureSlots", "rna_Material_update");
/* only material has this one */
prop= RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE);
@@ -1899,7 +1907,9 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch
RNA_def_property_flag(parm, PROP_REQUIRED);
}
-void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *structname_slots, const char *update)
+void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin,
+ const char *activeget, const char *activeset, const char *activeeditable,
+ const char *structname, const char *structname_slots, const char *update)
{
PropertyRNA *prop;
@@ -1913,6 +1923,8 @@ void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin, c
prop= RNA_def_property(srna, "active_texture", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
+ if(activeeditable)
+ RNA_def_property_editable_func(prop, activeeditable);
RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL, NULL);
RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed");
RNA_def_property_update(prop, 0, update);
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 5615e7141ee..4913e98a0af 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -1560,7 +1560,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_struct_ui_icon(srna, ICON_PARTICLE_DATA);
rna_def_mtex_common(brna, srna, "rna_ParticleSettings_mtex_begin", "rna_ParticleSettings_active_texture_get",
- "rna_ParticleSettings_active_texture_set", "ParticleSettingsTextureSlot", "ParticleSettingsTextureSlots", "rna_Particle_reset");
+ "rna_ParticleSettings_active_texture_set", NULL, "ParticleSettingsTextureSlot", "ParticleSettingsTextureSlots", "rna_Particle_reset");
/* fluid particle type can't be checked from the type value in rna as it's not shown in the menu */
prop= RNA_def_property(srna, "is_fluid", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index b8f8f5f5ded..72b54dce473 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -494,7 +494,7 @@ void RNA_def_world(BlenderRNA *brna)
rna_def_animdata_common(srna);
rna_def_mtex_common(brna, srna, "rna_World_mtex_begin", "rna_World_active_texture_get",
- "rna_World_active_texture_set", "WorldTextureSlot", "WorldTextureSlots", "rna_World_update");
+ "rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", "rna_World_update");
/* colors */
prop= RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);