[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2370] contrib/py/scripts/addons/ add_mesh_rocks: Testing permissions for Meta-Androcto.
Paul Marshall
portsidepaul at hotmail.com
Thu Sep 29 02:08:02 CEST 2011
Revision: 2370
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2370
Author: brikbot
Date: 2011-09-29 00:07:59 +0000 (Thu, 29 Sep 2011)
Log Message:
-----------
Testing permissions for Meta-Androcto.
Modified Paths:
--------------
contrib/py/scripts/addons/add_mesh_rocks/__init__.py
contrib/py/scripts/addons/add_mesh_rocks/add_mesh_rocks.xml
contrib/py/scripts/addons/add_mesh_rocks/factory.xml
contrib/py/scripts/addons/add_mesh_rocks/rockgen.py
contrib/py/scripts/addons/add_mesh_rocks/settings.py
contrib/py/scripts/addons/add_mesh_rocks/utils.py
Modified: contrib/py/scripts/addons/add_mesh_rocks/__init__.py
===================================================================
--- contrib/py/scripts/addons/add_mesh_rocks/__init__.py 2011-09-28 22:54:56 UTC (rev 2369)
+++ contrib/py/scripts/addons/add_mesh_rocks/__init__.py 2011-09-29 00:07:59 UTC (rev 2370)
@@ -11,7 +11,8 @@
#
# ##### BEGIN GPL LICENSE BLOCK #####
#
-# The Blender Rock Creation tool is for rapid generation of mesh rocks in Blender.
+# The Blender Rock Creation tool is for rapid generation of
+# mesh rocks in Blender.
# Copyright (C) 2011 Paul Marshall
#
# This program is free software: you can redistribute it and/or modify
@@ -32,12 +33,13 @@
bl_info = {
"name": "Rock Generator",
"author": "Paul Marshall (brikbot)",
- "version": (1,3),
+ "version": (1, 3),
"blender": (2, 5, 9),
"api": 40246,
"location": "View3D > Add > Rock Generator",
"description": "Adds a mesh rock to the Add Mesh menu",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Add_Mesh/Rock_Generator",
+ "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5"\
+ "/Py/Scripts/Add_Mesh/Rock_Generator",
"tracker_url": "http://projects.blender.org/tracker/index.php?"\
"func=detail&aid=27314",
"category": "Add Mesh"}
@@ -51,19 +53,24 @@
import bpy
# Register:
-
def menu_func_rocks(self, context):
- self.layout.operator(rockgen.rocks.bl_idname, text="Rock Generator", icon = "PLUGIN")
+ self.layout.operator(rockgen.rocks.bl_idname,
+ text = "Rock Generator",
+ icon = "PLUGIN")
+
def register():
bpy.utils.register_module(__name__)
bpy.types.INFO_MT_mesh_add.append(menu_func_rocks)
+
def unregister():
bpy.utils.unregister_module(__name__)
bpy.types.INFO_MT_mesh_add.remove(menu_func_rocks)
+
if __name__ == "__main__":
register()
+
Modified: contrib/py/scripts/addons/add_mesh_rocks/add_mesh_rocks.xml
===================================================================
--- contrib/py/scripts/addons/add_mesh_rocks/add_mesh_rocks.xml 2011-09-28 22:54:56 UTC (rev 2369)
+++ contrib/py/scripts/addons/add_mesh_rocks/add_mesh_rocks.xml 2011-09-29 00:07:59 UTC (rev 2370)
@@ -72,7 +72,7 @@
<deform>5.0</deform>
<rough>2.5</rough>
<detail>3</detail>
- <display_detail>3</display_detail>
+ <display_detail>2</display_detail>
<smooth_fac>0.0</smooth_fac>
<smooth_it>0</smooth_it>
</shape>
Modified: contrib/py/scripts/addons/add_mesh_rocks/factory.xml
===================================================================
--- contrib/py/scripts/addons/add_mesh_rocks/factory.xml 2011-09-28 22:54:56 UTC (rev 2369)
+++ contrib/py/scripts/addons/add_mesh_rocks/factory.xml 2011-09-29 00:07:59 UTC (rev 2370)
@@ -72,7 +72,7 @@
<deform>5.0</deform>
<rough>2.5</rough>
<detail>3</detail>
- <display_detail>3</display_detail>
+ <display_detail>2</display_detail>
<smooth_fac>0.0</smooth_fac>
<smooth_it>0</smooth_it>
</shape>
Modified: contrib/py/scripts/addons/add_mesh_rocks/rockgen.py
===================================================================
--- contrib/py/scripts/addons/add_mesh_rocks/rockgen.py 2011-09-28 22:54:56 UTC (rev 2369)
+++ contrib/py/scripts/addons/add_mesh_rocks/rockgen.py 2011-09-29 00:07:59 UTC (rev 2370)
@@ -55,7 +55,7 @@
# Remove all "bpy.ops" operations with "bpy.data" base operations.
# Remove material/texture cataloging with building a list of
# returned values from bpy.data.*.new() operations.
-# *** Completed on 9/6/2011 ***
+# *** Completed on 9/6/2011 ***
# Search for places where list comprehensions can be used.
# Look for alternate methods
# - Possible alternate and more efficient data structures
@@ -108,7 +108,9 @@
#
# ##### END GPL LICENSE BLOCK #####
-import bpy, math, time
+import (bpy,
+ math,
+ time)
from add_mesh_rocks import (settings,
utils)
from bpy_extras import object_utils
@@ -146,6 +148,7 @@
# Global variables:
lastRock = 0
+
# Creates a new mesh:
#
# param: verts - Vector of vertices for the mesh.
@@ -166,9 +169,8 @@
mesh.update()
return object_utils.object_data_add(context, mesh, operator=None)
-## import add_object_utils
-## return add_object_utils.object_data_add(context, mesh, operator=None)
+
# Set the values for a texture from parameters.
#
# param: texture - bpy.data.texture to modify.
@@ -176,7 +178,6 @@
# -> Below 10 is a displacment texture
# -> Between 10 and 20 is a base material texture
def randomizeTexture(texture, level=1):
-
noises = ['BLENDER_ORIGINAL', 'ORIGINAL_PERLIN', 'IMPROVED_PERLIN',
'VORONOI_F1', 'VORONOI_F2', 'VORONOI_F3', 'VORONOI_F4',
'VORONOI_F2_F1', 'VORONOI_CRACKLE']
@@ -193,46 +194,44 @@
texture.noise_depth = 8
if level == 0:
- texture.noise_scale = gauss(0.625, 1/24)
+ texture.noise_scale = gauss(0.625, 1 / 24)
elif level == 2:
texture.noise_scale = 0.15
elif level == 11:
- texture.noise_scale = gauss(0.5, 1/24)
-
- if texture.noise_basis in ['BLENDER_ORIGINAL','ORIGINAL_PERLIN',
+ texture.noise_scale = gauss(0.5, 1 / 24)
+
+ if texture.noise_basis in ['BLENDER_ORIGINAL', 'ORIGINAL_PERLIN',
'IMPROVED_PERLIN', 'VORONOI_F1']:
- texture.intensity = gauss(1, 1/6)
- texture.contrast = gauss(4, 1/3)
+ texture.intensity = gauss(1, 1 / 6)
+ texture.contrast = gauss(4, 1 / 3)
elif texture.noise_basis in ['VORONOI_F2', 'VORONOI_F3', 'VORONOI_F4']:
- texture.intensity = gauss(0.25, 1/12)
- texture.contrast = gauss(2, 1/6)
+ texture.intensity = gauss(0.25, 1 / 12)
+ texture.contrast = gauss(2, 1 / 6)
elif texture.noise_basis == 'VORONOI_F2_F1':
- texture.intensity = gauss(0.5, 1/6)
- texture.contrast = gauss(2, 1/6)
+ texture.intensity = gauss(0.5, 1 / 6)
+ texture.contrast = gauss(2, 1 / 6)
elif texture.noise_basis == 'VORONOI_CRACKLE':
- texture.intensity = gauss(0.5, 1/6)
- texture.contrast = gauss(2, 1/6)
+ texture.intensity = gauss(0.5, 1 / 6)
+ texture.contrast = gauss(2, 1 / 6)
elif texture.type == 'MUSGRAVE':
musgraveType = ['MULTIFRACTAL', 'RIDGED_MULTIFRACTAL',
'HYBRID_MULTIFRACTAL', 'FBM', 'HETERO_TERRAIN']
-## tempInt = randint(0, 3)
-## texture.musgrave_type = musgraveType[tempInt]
texture.musgrave_type = 'MULTIFRACTAL'
texture.dimension_max = abs(gauss(0, 0.6)) + 0.2
texture.lacunarity = beta(3, 8) * 8.2 + 1.8
if level == 0:
- texture.noise_scale = gauss(0.625, 1/24)
+ texture.noise_scale = gauss(0.625, 1 / 24)
texture.noise_intensity = 0.2
texture.octaves = 1.0
elif level == 2:
- texture.intensity = gauss(1, 1/6)
+ texture.intensity = gauss(1, 1 / 6)
texture.contrast = 0.2
texture.noise_scale = 0.15
texture.octaves = 8.0
elif level == 10:
- texture.intensity = gauss(0.25, 1/12)
- texture.contrast = gauss(1.5, 1/6)
+ texture.intensity = gauss(0.25, 1 / 12)
+ texture.contrast = gauss(1.5, 1 / 6)
texture.noise_scale = 0.5
texture.octaves = 8.0
elif level == 12:
@@ -240,7 +239,7 @@
elif level > 12:
texture.octaves = uniform(2, 8)
else:
- texture.intensity = gauss(1, 1/6)
+ texture.intensity = gauss(1, 1 / 6)
texture.contrast = 0.2
texture.octaves = 8.0
elif texture.type == 'DISTORTED_NOISE':
@@ -251,11 +250,11 @@
texture.distortion = skewedGauss(2.0, 2.6666, (0.0, 10.0), False)
if level == 0:
- texture.noise_scale = gauss(0.625, 1/24)
+ texture.noise_scale = gauss(0.625, 1 / 24)
elif level == 2:
texture.noise_scale = 0.15
elif level >= 12:
- texture.noise_scale = gauss(0.2, 1/48)
+ texture.noise_scale = gauss(0.2, 1 / 48)
elif texture.type == 'STUCCI':
stucciTypes = ['PLASTIC', 'WALL_IN', 'WALL_OUT']
if randint(0, 1) == 0:
@@ -268,7 +267,7 @@
if level == 0:
tempInt = randint(0, 6)
texture.noise_basis = noises[tempInt]
- texture.noise_scale = gauss(0.625, 1/24)
+ texture.noise_scale = gauss(0.625, 1 / 24)
elif level == 2:
tempInt = randint(0, 6)
texture.noise_basis = noises[tempInt]
@@ -276,7 +275,7 @@
elif level >= 12:
tempInt = randint(0, 6)
texture.noise_basis = noises[tempInt]
- texture.noise_scale = gauss(0.2, 1/30)
+ texture.noise_scale = gauss(0.2, 1 / 30)
else:
tempInt = randint(0, 6)
texture.noise_basis = noises[tempInt]
@@ -287,7 +286,7 @@
if level == 0:
tempInt = randint(0, 1)
texture.distance_metric = metrics[tempInt]
- texture.noise_scale = gauss(0.625, 1/24)
+ texture.noise_scale = gauss(0.625, 1 / 24)
texture.contrast = 0.5
texture.intensity = 0.7
elif level == 2:
@@ -297,15 +296,16 @@
elif level >= 12:
tempInt = randint(0, 1)
texture.distance_metric = metrics[tempInt]
- texture.noise_scale = gauss(0.125, 1/48)
+ texture.noise_scale = gauss(0.125, 1 / 48)
texture.contrast = 0.5
texture.intensity = 0.7
else:
tempInt = randint(0, 6)
texture.distance_metric = metrics[tempInt]
-
+
return
+
# Generates an object based on one of several different mesh types.
# All meshes have exactly eight vertices, and may be built from either
# tri's or quads.
@@ -333,7 +333,7 @@
x = []
y = []
z = []
- shape = randint(0,11)
+ shape = randint(0, 11)
# Cube
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list