[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4225] contrib/py/scripts/addons: added back the real gyes folder
Kilon Alios
thekilon at yahoo.co.uk
Sat Feb 2 17:27:57 CET 2013
Revision: 4225
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4225
Author: kilon
Date: 2013-02-02 16:27:57 +0000 (Sat, 02 Feb 2013)
Log Message:
-----------
added back the real gyes folder
Added Paths:
-----------
contrib/py/scripts/addons/gyes/
contrib/py/scripts/addons/gyes/__init__.py
contrib/py/scripts/addons/gyes/__pycache__/
contrib/py/scripts/addons/gyes/random_material_generator.py
contrib/py/scripts/addons/gyes/random_texture_generator.py
Added: contrib/py/scripts/addons/gyes/__init__.py
===================================================================
--- contrib/py/scripts/addons/gyes/__init__.py (rev 0)
+++ contrib/py/scripts/addons/gyes/__init__.py 2013-02-02 16:27:57 UTC (rev 4225)
@@ -0,0 +1,90 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+
+""" Copyright Kilon 2011 GPL licence applies"""
+
+bl_info = {
+ "name": "Gyes (Random Materials and Textures Generator)",
+ "description": "GYES is an addon that can produce Random Materials and Textures . The randomization is controlled by the user and so the user can set what is randomized and how much .",
+ "author": "Kilon",
+ "version": (1, 0, 0),
+ "blender": (2, 6, 0),
+ "api": 40500,
+ "location": "View3D > Left panel ",
+ "warning": '', # used for warning icon and text in addons panel
+ "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/System/Gyes",
+ "tracker_url": "https://github.com/kilon/Gyes",
+ "category": "Material"}
+
+if "bpy" in locals():
+ import imp
+ imp.reload(random_material_generator)
+ imp.reload(random_texture_generator)
+ #imp.reload(random_landscape_generator)
+else:
+ from gyes import random_material_generator
+ from gyes import random_texture_generator
+ #from gyes import random_landscape_generator
+import bpy
+from bpy.props import *
+
+
+# Choose the tool you want to use
+bpy.types.Scene.tool = EnumProperty(attr='tool', name='Tool', items=(
+('RMG', 'RMG', 'Random Material Generator'),
+('RTG', 'RTG', 'Random Texture Generator')), default='RMG')
+
+rm = random_material_generator.rm
+rt = random_texture_generator.rt
+
+
+# this the main panel
+class gyes_panel(bpy.types.Panel):
+ bl_label = "Gyes"
+ bl_space_type = "VIEW_3D"
+ bl_region_type = "TOOLS"
+
+ def draw(self, context):
+ layout = self.layout
+ row = layout.row()
+ row.prop(context.scene , "tool" )
+
+ # check which tool the user has selected (RGM is the default one) and display the appropriate gui
+
+ if context.scene.tool == 'RMG':
+ rm.draw_gui(context,self)
+
+ if context.scene.tool == 'RTG':
+ rt.draw_gui(context,self,rm)
+
+ r = layout.row()
+ if context.scene.tool == 'RLG':
+ r.label(text="WIP not finished yet")
+ if context.scene.tool == 'TARTARA':
+ r.label(text="WIP not finished yet")
+
+def register():
+ bpy.utils.register_module(__name__)
+
+def unregister():
+ bpy.utils.unregister_module(__name__)
+
+
+if __name__ == "__main__":
+ register()
Added: contrib/py/scripts/addons/gyes/random_material_generator.py
===================================================================
--- contrib/py/scripts/addons/gyes/random_material_generator.py (rev 0)
+++ contrib/py/scripts/addons/gyes/random_material_generator.py 2013-02-02 16:27:57 UTC (rev 4225)
@@ -0,0 +1,735 @@
+# first we import all the required modules
+
+import bpy ,random , copy
+from bpy.props import *
+import textwrap
+
+def h_names(self,contex):
+ h_list=list(rm.rm_history)
+ h_list.sort()
+ names=[]
+ for x in h_list:
+ names=names+[(x,x,x)]
+ return names
+
+class random_material_class:
+ """ this class contains all fuctions and variables concerning generation of random material """
+
+ def __init__(self):
+ """ several fuctions can be found here . All options for random generation . The History dictionary and several others."""
+
+ # various gui modes (simple, template etc)
+ bpy.types.Scene.gui_mode = EnumProperty(attr='mode', name='Mode', items=(
+('enable', 'Enable', 'Enable Disable material parameters for randomisation'),
+('percentage', 'Percentage' , 'here you define the percentage randomisation for each parameter'),
+('help', 'Help', 'Help documentation')), default='enable')
+
+ # Here I define the selective areas that the user can enable or disable for randomisation in simple mode
+
+ bpy.types.Scene.rdiffuse_shader = BoolProperty(name= "Diffuse Shader" ,description = "Enable/Disable Randomisation for the Diffuse Shader " , default = True)
+ bpy.types.Scene.rdiffuse_color = BoolProperty(name= "Diffuse Color" ,description = "Enable/Disable Randomisation for the Diffuse Color", default = True )
+ bpy.types.Scene.rdiffuse_intensity = BoolProperty(name= "Diffuse Intensity" ,description = "Enable/Disable Randomisation for the Diffuse Intensity" , default = True )
+ bpy.types.Scene.rspecular_color = BoolProperty(name= "Specular Color" ,description = "Enable/Disable Randomisation for the Specular Color" , default = True)
+ bpy.types.Scene.rspecular_shader = BoolProperty(name= "Specular Shader" ,description = "Enable/Disable Randomisation for the Specular Shader" , default = True)
+ bpy.types.Scene.rspecular_intensity = BoolProperty(name= "Specular Intensity" ,description = "Enable/Disable Randomisation for the Specular Intensity" , default = True)
+ bpy.types.Scene.rspecular_hardness = BoolProperty(name= "Specular Hardness" ,description = "Enable/Disable Randomisation for the Specular Hardness" , default = True)
+ bpy.types.Scene.rtransparency = BoolProperty(name= "Transparency" ,description = "Use and Randomise Transparency" , default = True)
+ bpy.types.Scene.rtexture = BoolProperty(name= "Texture" ,description = "Use and Randomise Textures" , default = True)
+
+ # Percentage randomisation
+ bpy.types.Scene.general_percentage = IntProperty(name="General percentage", description = " General percentage of randomisation" , min = 0 , max = 100 , default = 100, subtype = 'PERCENTAGE')
+ bpy.types.Scene.rdiffuse_shader_percentage = IntProperty(name="Diffuse shader", description = " Diffuse shader percentage of randomisation" , min = 0 , max = 100 , default = 0, subtype = 'PERCENTAGE')
+ bpy.types.Scene.rdiffuse_color_percentage = IntProperty(name="Diffuse Color", description = " Diffuse Color percentage of randomisation" , min = 0 , max = 100 , default = 0, subtype = 'PERCENTAGE')
+ bpy.types.Scene.rdiffuse_intensity_percentage = IntProperty(name="Diffuse Intensity", description = " Diffuse Intensity percentage of randomisation" , min = 0 , max = 100 , default = 0, subtype = 'PERCENTAGE')
+ bpy.types.Scene.rspecular_color_percentage = IntProperty(name="Specular Color", description = " Specular Color percentage of randomisation" , min = 0 , max = 100 , default = 0 , subtype = 'PERCENTAGE')
+ bpy.types.Scene.rspecular_shader_percentage = IntProperty(name="Specular Shader", description = " Specular Shader percentage of randomisation" , min = 0 , max = 100 , default = 0, subtype = 'PERCENTAGE')
+ bpy.types.Scene.rspecular_intensity_percentage = IntProperty(name="Specular Intensity", description = " Specular Intensity percentage of randomisation" , min = 0 , max = 100 , default = 0, subtype = 'PERCENTAGE')
+ bpy.types.Scene.rspecular_hardness_percentage = IntProperty(name="Specular Hardness", description = " Specular Hardness percentage of randomisation" , min = 0 , max = 100 , default = 0, subtype = 'PERCENTAGE')
+ bpy.types.Scene.rtransparency_percentage = IntProperty(name="Transparency", description = " Transparency percentage of randomisation" , min = 0 , max = 100 , default = 0, subtype = 'PERCENTAGE')
+
+ # this is the dictionary that stores history
+ bpy.types.Scene.history_index = IntProperty(name= "History Index" ,description = "The Number of Random Material Assigned to the Active MAterial of the Selected Object from the history" , default = 1, min = 1 )
+ bpy.types.Scene.filter = StringProperty(name="Filter", description ="Filter text , only if the text matches even partially with the material name will be stored")
+ self.rm_history={"slot 01":{1:{}} , "slot 02":{1:{}} , "slot 03":{1:{}} ,"slot 04":{1:{}} ,"slot 05":{1:{}} ,"slot 06":{1:{}} ,
+ "slot 07":{1:{}} ,"slot 08":{1:{}} , "slot 09":{1:{}} , "slot 10":{1:{}} ,"slot 11":{1:{}} ,"slot 12":{1:{}} }
+ self.delete_start_index=1
+ bpy.types.Scene.h_selected = EnumProperty(attr='name', name='Name :', items=h_names)
+
+
+ # the prop that controls the text wrap in help menu
+ bpy.types.Scene.text_width = IntProperty(name = "Text Width" , description = "The width above which the text wraps" , default = 20 , max = 180 , min = 1)
+
+ # here is where history dictionary is saved with the blend file
+ # if the backup is already saved with the blend file it is used
+ # to restory the history dictionary , if not it is created
+
+ #if hasattr(bpy.context.scene , "historybak")==False:
+ bpy.types.Scene.historybak = StringProperty()
+ print("Gyes log : created history backup")
+
+
+
+ # non read only material properties where keyframes can be inserted or removed
+ self.animated_properties=["alpha",
+ "ambient",
+ "darkness",
+ "diffuse_color",
+ "diffuse_fresnel",
+ "diffuse_fresnel_factor",
+ "diffuse_intensity",
+ "diffuse_ramp_blend",
+ "diffuse_ramp_factor",
+ "diffuse_ramp_input",
+ "diffuse_shader",
+ "diffuse_toon_size",
+ "diffuse_toon_smooth",
+ "emit",
+ "invert_z",
+ "mirror_color",
+ "offset_z",
+ "preview_render_type",
+ "roughness",
+ "shadow_buffer_bias",
+ "shadow_cast_alpha",
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list