[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53059] trunk/blender: Cycles: add " Textures" panel in particle properties, to make it possble to add

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Dec 16 13:55:58 CET 2012


Revision: 53059
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53059
Author:   blendix
Date:     2012-12-16 12:55:52 +0000 (Sun, 16 Dec 2012)
Log Message:
-----------
Cycles: add "Textures" panel in particle properties, to make it possble to add
textures when Cycles is selected as render engine.

Modified Paths:
--------------
    trunk/blender/intern/cycles/blender/addon/ui.py
    trunk/blender/source/blender/editors/space_buttons/buttons_texture.c

Modified: trunk/blender/intern/cycles/blender/addon/ui.py
===================================================================
--- trunk/blender/intern/cycles/blender/addon/ui.py	2012-12-16 11:47:13 UTC (rev 53058)
+++ trunk/blender/intern/cycles/blender/addon/ui.py	2012-12-16 12:55:52 UTC (rev 53059)
@@ -915,6 +915,37 @@
             layout.template_color_ramp(mapping, "color_ramp", expand=True)
 
 
+class CyclesParticle_PT_textures(CyclesButtonsPanel, Panel):
+    bl_label = "Textures"
+    bl_context = "particle"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        psys = context.particle_system
+        return psys and CyclesButtonsPanel.poll(context)
+
+    def draw(self, context):
+        layout = self.layout
+
+        psys = context.particle_system
+        part = psys.settings
+
+        row = layout.row()
+        row.template_list(part, "texture_slots", part, "active_texture_index", rows=2)
+
+        col = row.column(align=True)
+        col.operator("texture.slot_move", text="", icon='TRIA_UP').type = 'UP'
+        col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN'
+        col.menu("TEXTURE_MT_specials", icon='DOWNARROW_HLT', text="")
+
+        if not part.active_texture:
+            layout.template_ID(part, "active_texture", new="texture.new")
+        else:
+            slot = part.texture_slots[part.active_texture_index]
+            layout.template_ID(slot, "texture", new="texture.new")
+
+
 class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel):
     bl_label = "Simplify"
     bl_context = "scene"
@@ -1027,6 +1058,7 @@
         bpy.types.TEXTURE_PT_pointdensity_turbulence,
         bpy.types.TEXTURE_PT_mapping,
         bpy.types.TEXTURE_PT_influence,
+        bpy.types.TEXTURE_PT_colors,
         bpy.types.PARTICLE_PT_context_particles,
         bpy.types.PARTICLE_PT_emission,
         bpy.types.PARTICLE_PT_hair_dynamics,

Modified: trunk/blender/source/blender/editors/space_buttons/buttons_texture.c
===================================================================
--- trunk/blender/source/blender/editors/space_buttons/buttons_texture.c	2012-12-16 11:47:13 UTC (rev 53058)
+++ trunk/blender/source/blender/editors/space_buttons/buttons_texture.c	2012-12-16 12:55:52 UTC (rev 53059)
@@ -358,8 +358,18 @@
 		}
 
 		/* create button */
-		BLI_snprintf(name, UI_MAX_NAME_STR, "  %s", user->name);
+		if (user->prop) {
+			PointerRNA texptr = RNA_property_pointer_get(&user->ptr, user->prop);
+			Tex *tex = texptr.data;
 
+			if (tex)
+				BLI_snprintf(name, UI_MAX_NAME_STR, "  %s - %s", user->name, tex->id.name+2);
+			else
+				BLI_snprintf(name, UI_MAX_NAME_STR, "  %s", user->name);
+		}
+		else
+			BLI_snprintf(name, UI_MAX_NAME_STR, "  %s", user->name);
+
 		but = uiDefIconTextBut(block, BUT, 0, user->icon, name, 0, 0, UI_UNIT_X * 4, UI_UNIT_Y,
 		                       NULL, 0.0, 0.0, 0.0, 0.0, "");
 		uiButSetNFunc(but, template_texture_select, MEM_dupallocN(user), NULL);




More information about the Bf-blender-cvs mailing list