Skip to content
Snippets Groups Projects
Commit 02436fd9 authored by Paul Marshall's avatar Paul Marshall
Browse files

Small bug fix plus added the ability to enable and configure some transparency...

Small bug fix plus added the ability to enable and configure some transparency settings.  This allows the add-on to generate jems/ice.
parent 55dac667
Branches
Tags
No related merge requests found
# Paul "BrikBot" Marshall # Paul "BrikBot" Marshall
# Created: July 1, 2011 # Created: July 1, 2011
# Last Modified: September 16, 2011 # Last Modified: November 17, 2011
# Homepage (blog): http://post.darkarsenic.com/ # Homepage (blog): http://post.darkarsenic.com/
# //blog.darkarsenic.com/ # //blog.darkarsenic.com/
# Thanks to Meta-Androco, RickyBlender, Ace Dragon, and PKHG for ideas # Thanks to Meta-Androco, RickyBlender, Ace Dragon, and PKHG for ideas
...@@ -36,8 +36,8 @@ bl_info = { ...@@ -36,8 +36,8 @@ bl_info = {
"name": "Rock Generator", "name": "Rock Generator",
"author": "Paul Marshall (brikbot)", "author": "Paul Marshall (brikbot)",
"version": (1, 3), "version": (1, 3),
"blender": (2, 5, 9), "blender": (2, 6, 0),
"api": 40246, "api": 41875,
"location": "View3D > Add > Rock Generator", "location": "View3D > Add > Rock Generator",
"description": "Adds a mesh rock to the Add Mesh menu", "description": "Adds a mesh rock to the Add Mesh menu",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5"\ "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5"\
......
...@@ -20,13 +20,17 @@ ...@@ -20,13 +20,17 @@
<!ELEMENT display_detail (#PCDATA)> <!ELEMENT display_detail (#PCDATA)>
<!ELEMENT smooth_fac (#PCDATA)> <!ELEMENT smooth_fac (#PCDATA)>
<!ELEMENT smooth_it (#PCDATA)> <!ELEMENT smooth_it (#PCDATA)>
<!ELEMENT material (mat_enable,mat_color,mat_bright,mat_rough,mat_spec,mat_hard,mat_mossy)> <!ELEMENT material (mat_enable,mat_color,mat_bright,mat_rough,mat_spec,mat_hard,mat_use_trans,mat_alpha,mat_cloudy,mat_IOR,mat_mossy)>
<!ELEMENT mat_enable (#PCDATA)> <!ELEMENT mat_enable (#PCDATA)>
<!ELEMENT mat_color (#PCDATA)> <!ELEMENT mat_color (#PCDATA)>
<!ELEMENT mat_bright (#PCDATA)> <!ELEMENT mat_bright (#PCDATA)>
<!ELEMENT mat_rough (#PCDATA)> <!ELEMENT mat_rough (#PCDATA)>
<!ELEMENT mat_spec (#PCDATA)> <!ELEMENT mat_spec (#PCDATA)>
<!ELEMENT mat_hard (#PCDATA)> <!ELEMENT mat_hard (#PCDATA)>
<!ELEMENT mat_use_trans (#PCDATA)>
<!ELEMENT mat_alpha (#PCDATA)>
<!ELEMENT mat_cloudy (#PCDATA)>
<!ELEMENT mat_IOR (#PCDATA)>
<!ELEMENT mat_mossy (#PCDATA)> <!ELEMENT mat_mossy (#PCDATA)>
<!ELEMENT random (use_random_seed,user_seed)> <!ELEMENT random (use_random_seed,user_seed)>
<!ELEMENT use_random_seed (#PCDATA)> <!ELEMENT use_random_seed (#PCDATA)>
...@@ -83,6 +87,10 @@ ...@@ -83,6 +87,10 @@
<mat_rough>1.0</mat_rough> <mat_rough>1.0</mat_rough>
<mat_spec>0.2</mat_spec> <mat_spec>0.2</mat_spec>
<mat_hard>50</mat_hard> <mat_hard>50</mat_hard>
<mat_use_trans>False</mat_use_trans>
<mat_alpha>0.0</mat_alpha>
<mat_cloudy>0.0</mat_cloudy>
<mat_IOR>1.0</mat_IOR>
<mat_mossy>0.0</mat_mossy> <mat_mossy>0.0</mat_mossy>
</material> </material>
<random> <random>
...@@ -132,12 +140,16 @@ ...@@ -132,12 +140,16 @@
<smooth_it>2</smooth_it> <smooth_it>2</smooth_it>
</shape> </shape>
<material> <material>
<mat_enable>False</mat_enable> <mat_enable>True</mat_enable>
<mat_color>[0.5, 0.5, 0.5]</mat_color> <mat_color>[0.5, 0.5, 0.5]</mat_color>
<mat_bright>0.85</mat_bright> <mat_bright>0.85</mat_bright>
<mat_rough>0.125</mat_rough> <mat_rough>0.125</mat_rough>
<mat_spec>0.5</mat_spec> <mat_spec>0.5</mat_spec>
<mat_hard>50</mat_hard> <mat_hard>50</mat_hard>
<mat_use_trans>False</mat_use_trans>
<mat_alpha>0.0</mat_alpha>
<mat_cloudy>0.0</mat_cloudy>
<mat_IOR>1.0</mat_IOR>
<mat_mossy>0.0</mat_mossy> <mat_mossy>0.0</mat_mossy>
</material> </material>
<random> <random>
...@@ -187,12 +199,16 @@ ...@@ -187,12 +199,16 @@
<smooth_it>0</smooth_it> <smooth_it>0</smooth_it>
</shape> </shape>
<material> <material>
<mat_enable>False</mat_enable> <mat_enable>True</mat_enable>
<mat_color>[0.3, 0.25, 0.2]</mat_color> <mat_color>[0.3, 0.25, 0.2]</mat_color>
<mat_bright>0.85</mat_bright> <mat_bright>0.85</mat_bright>
<mat_rough>1.5</mat_rough> <mat_rough>1.5</mat_rough>
<mat_spec>0.25</mat_spec> <mat_spec>0.25</mat_spec>
<mat_hard>30</mat_hard> <mat_hard>30</mat_hard>
<mat_use_trans>False</mat_use_trans>
<mat_alpha>0.0</mat_alpha>
<mat_cloudy>0.0</mat_cloudy>
<mat_IOR>1.0</mat_IOR>
<mat_mossy>0.0</mat_mossy> <mat_mossy>0.0</mat_mossy>
</material> </material>
<random> <random>
...@@ -242,12 +258,134 @@ ...@@ -242,12 +258,134 @@
<smooth_it>2</smooth_it> <smooth_it>2</smooth_it>
</shape> </shape>
<material> <material>
<mat_enable>False</mat_enable> <mat_enable>True</mat_enable>
<mat_color>[0.5, 0.4, 0.35]</mat_color> <mat_color>[0.5, 0.4, 0.35]</mat_color>
<mat_bright>0.85</mat_bright> <mat_bright>0.85</mat_bright>
<mat_rough>0.1</mat_rough> <mat_rough>0.1</mat_rough>
<mat_spec>0.2</mat_spec> <mat_spec>0.2</mat_spec>
<mat_hard>50</mat_hard> <mat_hard>50</mat_hard>
<mat_use_trans>False</mat_use_trans>
<mat_alpha>0.0</mat_alpha>
<mat_cloudy>0.0</mat_cloudy>
<mat_IOR>1.0</mat_IOR>
<mat_mossy>0.0</mat_mossy>
</material>
<random>
<use_random_seed>True</use_random_seed>
<user_seed>1</user_seed>
</random>
</preset>
<preset id="4">
<title>Ice</title>
<size>
<scale>
<axis>X</axis>
<lower>0.0</lower>
<upper>2.0</upper>
</scale>
<scale>
<axis>Y</axis>
<lower>0.0</lower>
<upper>2.0</upper>
</scale>
<scale>
<axis>Z</axis>
<lower>0.0</lower>
<upper>2.0</upper>
</scale>
<skew>
<axis>X</axis>
<value>0.0</value>
</skew>
<skew>
<axis>Y</axis>
<value>0.0</value>
</skew>
<skew>
<axis>Z</axis>
<value>0.0</value>
</skew>
<use_scale_dis>False</use_scale_dis>
<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
</size>
<shape>
<deform>5.0</deform>
<rough>1.0</rough>
<detail>3</detail>
<display_detail>2</display_detail>
<smooth_fac>2.0</smooth_fac>
<smooth_it>1</smooth_it>
</shape>
<material>
<mat_enable>True</mat_enable>
<mat_color>[0.9, 0.95, 1.0]</mat_color>
<mat_bright>0.85</mat_bright>
<mat_rough>0.25</mat_rough>
<mat_spec>0.2</mat_spec>
<mat_hard>50</mat_hard>
<mat_use_trans>True</mat_use_trans>
<mat_alpha>0.9</mat_alpha>
<mat_cloudy>0.1</mat_cloudy>
<mat_IOR>1.31</mat_IOR>
<mat_mossy>0.0</mat_mossy>
</material>
<random>
<use_random_seed>True</use_random_seed>
<user_seed>1</user_seed>
</random>
</preset>
<preset id="5">
<title>Fake Ocean</title>
<size>
<scale>
<axis>X</axis>
<lower>10.0</lower>
<upper>10.0</upper>
</scale>
<scale>
<axis>Y</axis>
<lower>10.0</lower>
<upper>10.0</upper>
</scale>
<scale>
<axis>Z</axis>
<lower>0.0</lower>
<upper>0.0</upper>
</scale>
<skew>
<axis>X</axis>
<value>0.0</value>
</skew>
<skew>
<axis>Y</axis>
<value>0.0</value>
</skew>
<skew>
<axis>Z</axis>
<value>0.0</value>
</skew>
<use_scale_dis>False</use_scale_dis>
<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
</size>
<shape>
<deform>7.5</deform>
<rough>3.0</rough>
<detail>4</detail>
<display_detail>3</display_detail>
<smooth_fac>0.0</smooth_fac>
<smooth_it>0</smooth_it>
</shape>
<material>
<mat_enable>True</mat_enable>
<mat_color>[0.1, 0.12, 0.125]</mat_color>
<mat_bright>0.85</mat_bright>
<mat_rough>1.5</mat_rough>
<mat_spec>0.25</mat_spec>
<mat_hard>30</mat_hard>
<mat_use_trans>True</mat_use_trans>
<mat_alpha>0.5</mat_alpha>
<mat_cloudy>0.5</mat_cloudy>
<mat_IOR>1.333</mat_IOR>
<mat_mossy>0.0</mat_mossy> <mat_mossy>0.0</mat_mossy>
</material> </material>
<random> <random>
......
...@@ -20,13 +20,17 @@ ...@@ -20,13 +20,17 @@
<!ELEMENT display_detail (#PCDATA)> <!ELEMENT display_detail (#PCDATA)>
<!ELEMENT smooth_fac (#PCDATA)> <!ELEMENT smooth_fac (#PCDATA)>
<!ELEMENT smooth_it (#PCDATA)> <!ELEMENT smooth_it (#PCDATA)>
<!ELEMENT material (mat_enable,mat_color,mat_bright,mat_rough,mat_spec,mat_hard,mat_mossy)> <!ELEMENT material (mat_enable,mat_color,mat_bright,mat_rough,mat_spec,mat_hard,mat_use_trans,mat_alpha,mat_cloudy,mat_IOR,mat_mossy)>
<!ELEMENT mat_enable (#PCDATA)> <!ELEMENT mat_enable (#PCDATA)>
<!ELEMENT mat_color (#PCDATA)> <!ELEMENT mat_color (#PCDATA)>
<!ELEMENT mat_bright (#PCDATA)> <!ELEMENT mat_bright (#PCDATA)>
<!ELEMENT mat_rough (#PCDATA)> <!ELEMENT mat_rough (#PCDATA)>
<!ELEMENT mat_spec (#PCDATA)> <!ELEMENT mat_spec (#PCDATA)>
<!ELEMENT mat_hard (#PCDATA)> <!ELEMENT mat_hard (#PCDATA)>
<!ELEMENT mat_use_trans (#PCDATA)>
<!ELEMENT mat_alpha (#PCDATA)>
<!ELEMENT mat_cloudy (#PCDATA)>
<!ELEMENT mat_IOR (#PCDATA)>
<!ELEMENT mat_mossy (#PCDATA)> <!ELEMENT mat_mossy (#PCDATA)>
<!ELEMENT random (use_random_seed,user_seed)> <!ELEMENT random (use_random_seed,user_seed)>
<!ELEMENT use_random_seed (#PCDATA)> <!ELEMENT use_random_seed (#PCDATA)>
...@@ -83,6 +87,10 @@ ...@@ -83,6 +87,10 @@
<mat_rough>1.0</mat_rough> <mat_rough>1.0</mat_rough>
<mat_spec>0.2</mat_spec> <mat_spec>0.2</mat_spec>
<mat_hard>50</mat_hard> <mat_hard>50</mat_hard>
<mat_use_trans>False</mat_use_trans>
<mat_alpha>0.0</mat_alpha>
<mat_cloudy>0.0</mat_cloudy>
<mat_IOR>1.0</mat_IOR>
<mat_mossy>0.0</mat_mossy> <mat_mossy>0.0</mat_mossy>
</material> </material>
<random> <random>
...@@ -132,12 +140,16 @@ ...@@ -132,12 +140,16 @@
<smooth_it>2</smooth_it> <smooth_it>2</smooth_it>
</shape> </shape>
<material> <material>
<mat_enable>False</mat_enable> <mat_enable>True</mat_enable>
<mat_color>[0.5, 0.5, 0.5]</mat_color> <mat_color>[0.5, 0.5, 0.5]</mat_color>
<mat_bright>0.85</mat_bright> <mat_bright>0.85</mat_bright>
<mat_rough>0.125</mat_rough> <mat_rough>0.125</mat_rough>
<mat_spec>0.5</mat_spec> <mat_spec>0.5</mat_spec>
<mat_hard>50</mat_hard> <mat_hard>50</mat_hard>
<mat_use_trans>False</mat_use_trans>
<mat_alpha>0.0</mat_alpha>
<mat_cloudy>0.0</mat_cloudy>
<mat_IOR>1.0</mat_IOR>
<mat_mossy>0.0</mat_mossy> <mat_mossy>0.0</mat_mossy>
</material> </material>
<random> <random>
...@@ -187,12 +199,16 @@ ...@@ -187,12 +199,16 @@
<smooth_it>0</smooth_it> <smooth_it>0</smooth_it>
</shape> </shape>
<material> <material>
<mat_enable>False</mat_enable> <mat_enable>True</mat_enable>
<mat_color>[0.3, 0.25, 0.2]</mat_color> <mat_color>[0.3, 0.25, 0.2]</mat_color>
<mat_bright>0.85</mat_bright> <mat_bright>0.85</mat_bright>
<mat_rough>1.5</mat_rough> <mat_rough>1.5</mat_rough>
<mat_spec>0.25</mat_spec> <mat_spec>0.25</mat_spec>
<mat_hard>30</mat_hard> <mat_hard>30</mat_hard>
<mat_use_trans>False</mat_use_trans>
<mat_alpha>0.0</mat_alpha>
<mat_cloudy>0.0</mat_cloudy>
<mat_IOR>1.0</mat_IOR>
<mat_mossy>0.0</mat_mossy> <mat_mossy>0.0</mat_mossy>
</material> </material>
<random> <random>
...@@ -242,12 +258,134 @@ ...@@ -242,12 +258,134 @@
<smooth_it>2</smooth_it> <smooth_it>2</smooth_it>
</shape> </shape>
<material> <material>
<mat_enable>False</mat_enable> <mat_enable>True</mat_enable>
<mat_color>[0.5, 0.4, 0.35]</mat_color> <mat_color>[0.5, 0.4, 0.35]</mat_color>
<mat_bright>0.85</mat_bright> <mat_bright>0.85</mat_bright>
<mat_rough>0.1</mat_rough> <mat_rough>0.1</mat_rough>
<mat_spec>0.2</mat_spec> <mat_spec>0.2</mat_spec>
<mat_hard>50</mat_hard> <mat_hard>50</mat_hard>
<mat_use_trans>False</mat_use_trans>
<mat_alpha>0.0</mat_alpha>
<mat_cloudy>0.0</mat_cloudy>
<mat_IOR>1.0</mat_IOR>
<mat_mossy>0.0</mat_mossy>
</material>
<random>
<use_random_seed>True</use_random_seed>
<user_seed>1</user_seed>
</random>
</preset>
<preset id="4">
<title>Ice</title>
<size>
<scale>
<axis>X</axis>
<lower>0.0</lower>
<upper>2.0</upper>
</scale>
<scale>
<axis>Y</axis>
<lower>0.0</lower>
<upper>2.0</upper>
</scale>
<scale>
<axis>Z</axis>
<lower>0.0</lower>
<upper>2.0</upper>
</scale>
<skew>
<axis>X</axis>
<value>0.0</value>
</skew>
<skew>
<axis>Y</axis>
<value>0.0</value>
</skew>
<skew>
<axis>Z</axis>
<value>0.0</value>
</skew>
<use_scale_dis>False</use_scale_dis>
<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
</size>
<shape>
<deform>5.0</deform>
<rough>1.0</rough>
<detail>3</detail>
<display_detail>2</display_detail>
<smooth_fac>2.0</smooth_fac>
<smooth_it>1</smooth_it>
</shape>
<material>
<mat_enable>True</mat_enable>
<mat_color>[0.9, 0.95, 1.0]</mat_color>
<mat_bright>0.85</mat_bright>
<mat_rough>0.25</mat_rough>
<mat_spec>0.2</mat_spec>
<mat_hard>50</mat_hard>
<mat_use_trans>True</mat_use_trans>
<mat_alpha>0.9</mat_alpha>
<mat_cloudy>0.1</mat_cloudy>
<mat_IOR>1.31</mat_IOR>
<mat_mossy>0.0</mat_mossy>
</material>
<random>
<use_random_seed>True</use_random_seed>
<user_seed>1</user_seed>
</random>
</preset>
<preset id="5">
<title>Fake Ocean</title>
<size>
<scale>
<axis>X</axis>
<lower>10.0</lower>
<upper>10.0</upper>
</scale>
<scale>
<axis>Y</axis>
<lower>10.0</lower>
<upper>10.0</upper>
</scale>
<scale>
<axis>Z</axis>
<lower>0.0</lower>
<upper>0.0</upper>
</scale>
<skew>
<axis>X</axis>
<value>0.0</value>
</skew>
<skew>
<axis>Y</axis>
<value>0.0</value>
</skew>
<skew>
<axis>Z</axis>
<value>0.0</value>
</skew>
<use_scale_dis>False</use_scale_dis>
<scale_fac>[1.0, 1.0, 1.0]</scale_fac>
</size>
<shape>
<deform>7.5</deform>
<rough>3.0</rough>
<detail>4</detail>
<display_detail>3</display_detail>
<smooth_fac>0.0</smooth_fac>
<smooth_it>0</smooth_it>
</shape>
<material>
<mat_enable>True</mat_enable>
<mat_color>[0.1, 0.12, 0.125]</mat_color>
<mat_bright>0.85</mat_bright>
<mat_rough>1.5</mat_rough>
<mat_spec>0.25</mat_spec>
<mat_hard>30</mat_hard>
<mat_use_trans>True</mat_use_trans>
<mat_alpha>0.5</mat_alpha>
<mat_cloudy>0.5</mat_cloudy>
<mat_IOR>1.333</mat_IOR>
<mat_mossy>0.0</mat_mossy> <mat_mossy>0.0</mat_mossy>
</material> </material>
<random> <random>
......
This diff is collapsed.
# Paul "BrikBot" Marshall
# Created: July 1, 2011
# Last Modified: November 17, 2011
# Homepage (blog): http://post.darkarsenic.com/
# //blog.darkarsenic.com/
# Thanks to Meta-Androco, RickyBlender, Ace Dragon, and PKHG for ideas
# and testing.
#
# Coded in IDLE, tested in Blender 2.59. NumPy Recommended.
# Search for "@todo" to quickly find sections that need work.
#
# ##### BEGIN GPL LICENSE BLOCK ##### # ##### BEGIN GPL LICENSE BLOCK #####
# #
# The Blender Rock Creation tool is for rapid generation of mesh rocks. # The Blender Rock Creation tool is for rapid generation of
# mesh rocks in Blender.
# Copyright (C) 2011 Paul Marshall # Copyright (C) 2011 Paul Marshall
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
...@@ -123,7 +135,14 @@ def parseNode(setting, title = True): ...@@ -123,7 +135,14 @@ def parseNode(setting, title = True):
mat_rough = float(setting.childNodes[loc].childNodes[7].childNodes[0].data) mat_rough = float(setting.childNodes[loc].childNodes[7].childNodes[0].data)
mat_spec = float(setting.childNodes[loc].childNodes[9].childNodes[0].data) mat_spec = float(setting.childNodes[loc].childNodes[9].childNodes[0].data)
mat_hard = int(setting.childNodes[loc].childNodes[11].childNodes[0].data) mat_hard = int(setting.childNodes[loc].childNodes[11].childNodes[0].data)
mat_mossy = float(setting.childNodes[loc].childNodes[13].childNodes[0].data) mat_use_trans = bool(setting.childNodes[loc].childNodes[13].childNodes[0].data)
mat_alpha = float(setting.childNodes[loc].childNodes[15].childNodes[0].data)
mat_cloudy = float(setting.childNodes[loc].childNodes[17].childNodes[0].data)
mat_IOR = float(setting.childNodes[loc].childNodes[19].childNodes[0].data)
#mat_use_mirror = float(setting.childNodes[loc].childNodes[21].childNodes[0].data)
#mat_mossy = float(setting.childNodes[loc].childNodes[23].childNodes[0].data)
#mat_mossy = float(setting.childNodes[loc].childNodes[25].childNodes[0].data)
mat_mossy = float(setting.childNodes[loc].childNodes[21].childNodes[0].data)
loc += 2 loc += 2
# Preset random values (xmlPreset.childNodes[9]): # Preset random values (xmlPreset.childNodes[9]):
...@@ -137,13 +156,15 @@ def parseNode(setting, title = True): ...@@ -137,13 +156,15 @@ def parseNode(setting, title = True):
parsed = [title, scaleX, scaleY, scaleZ, skewX, skewY, skewZ, parsed = [title, scaleX, scaleY, scaleZ, skewX, skewY, skewZ,
use_scale_dis, scale_fac, deform, rough, detail, use_scale_dis, scale_fac, deform, rough, detail,
display_detail, smooth_fac, smooth_it, mat_enable, mat_color, display_detail, smooth_fac, smooth_it, mat_enable, mat_color,
mat_bright, mat_rough, mat_spec, mat_hard, mat_mossy, mat_bright, mat_rough, mat_spec, mat_hard, mat_use_trans,
use_random_seed, user_seed] mat_alpha, mat_cloudy, mat_IOR, mat_mossy, use_random_seed,
user_seed]
else: else:
parsed = [scaleX, scaleY, scaleZ, skewX, skewY, skewZ, use_scale_dis, parsed = [scaleX, scaleY, scaleZ, skewX, skewY, skewZ, use_scale_dis,
scale_fac, deform, rough, detail, display_detail, smooth_fac, scale_fac, deform, rough, detail, display_detail, smooth_fac,
smooth_it, mat_enable, mat_color, mat_bright, mat_rough, smooth_it, mat_enable, mat_color, mat_bright, mat_rough,
mat_spec, mat_hard, mat_mossy, use_random_seed, user_seed] mat_spec, mat_hard, mat_use_trans, mat_alpha, mat_cloudy,
mat_IOR, mat_mossy, use_random_seed, user_seed]
return parsed return parsed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment