Fix T58881: FBX error exporting tangent space
[blender-addons.git] / ant_landscape / __init__.py
blobfd758e3327d6c5b889460ffc72ed8422a658da91
1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
19 # Another Noise Tool - Suite (W.I.P.)
20 # Jimmy Hazevoet 5/2017
22 bl_info = {
23 "name": "A.N.T.Landscape",
24 "author": "Jimmy Hazevoet",
25 "version": (0, 1, 8),
26 "blender": (2, 78, 0),
27 "location": "View3D > Tool Shelf",
28 "description": "Another Noise Tool: Landscape and Displace",
29 "warning": "",
30 "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/"
31 "Scripts/Add_Mesh/ANT_Landscape",
32 "category": "Add Mesh",
35 if "bpy" in locals():
36 import importlib
37 importlib.reload(add_mesh_ant_landscape)
38 importlib.reload(mesh_ant_displace)
39 importlib.reload(ant_functions)
40 importlib.reload(ant_noise)
41 else:
42 from ant_landscape import add_mesh_ant_landscape
43 from ant_landscape import mesh_ant_displace
44 from ant_landscape import ant_functions
45 from ant_landscape import ant_noise
47 import bpy
49 from bpy.props import (
50 BoolProperty,
51 FloatProperty,
52 IntProperty,
53 StringProperty,
54 PointerProperty,
55 EnumProperty,
57 from .ant_functions import (
58 draw_ant_refresh,
59 draw_ant_main,
60 draw_ant_noise,
61 draw_ant_displace,
64 # ------------------------------------------------------------
65 # Menu's and panels
67 def menu_func_eroder(self, context):
68 ob = bpy.context.active_object
69 if ob and (ob.ant_landscape.keys() and not ob.ant_landscape['sphere_mesh']):
70 self.layout.operator('mesh.eroder', text="Landscape Eroder", icon='SMOOTHCURVE')
73 def menu_func_landscape(self, context):
74 self.layout.operator('mesh.landscape_add', text="Landscape", icon="RNDCURVE")
77 # Landscape Add Panel
78 class panel_func_add_landscape(bpy.types.Panel):
79 bl_idname = "ANTLANDSCAPE_PT_add"
80 bl_space_type = "VIEW_3D"
81 bl_context = "objectmode"
82 bl_region_type = "TOOLS"
83 bl_label = "Landscape"
84 bl_category = "Create"
85 bl_options = {'DEFAULT_CLOSED'}
87 def draw(self, context):
88 col = self.layout.column()
89 col.operator('mesh.landscape_add', text="Landscape", icon="RNDCURVE")
92 # Landscape Tools:
93 class AntLandscapeToolsPanel(bpy.types.Panel):
94 bl_idname = "ANTLANDSCAPE_PT_tools"
95 bl_space_type = "VIEW_3D"
96 bl_context = "objectmode"
97 bl_region_type = "TOOLS"
98 bl_label = "Landscape Tools"
99 bl_category = "Tools"
100 bl_options = {'DEFAULT_CLOSED'}
102 @classmethod
103 def poll(cls, context):
104 ob = bpy.context.active_object
105 return (ob and ob.type == 'MESH')
107 def draw(self, context):
108 layout = self.layout
109 ob = context.active_object
110 col = layout.column()
111 col.operator('mesh.ant_displace', text="Mesh Displace", icon="RNDCURVE")
112 col.operator('mesh.ant_slope_map', icon='GROUP_VERTEX')
113 if ob.ant_landscape.keys() and not ob.ant_landscape['sphere_mesh']:
114 col.operator('mesh.eroder', text="Landscape Eroder", icon='SMOOTHCURVE')
117 # Landscape Main Settings
118 class AntMainSettingsPanel(bpy.types.Panel):
119 bl_idname = "ANTMAIN_PT_layout"
120 bl_options = {'DEFAULT_CLOSED'}
121 bl_space_type = 'VIEW_3D'
122 bl_region_type = 'UI'
123 bl_context = "object"
124 bl_label = "Landscape Main"
126 @classmethod
127 def poll(cls, context):
128 ob = bpy.context.active_object
129 return ob.ant_landscape.keys() if ob else False
131 def draw(self, context):
132 layout = self.layout
133 scene = context.scene
134 ob = bpy.context.active_object
135 ant = ob.ant_landscape
136 box = layout.box()
137 col = box.column(align=False)
138 col.scale_y = 1.5
139 col.operator('mesh.ant_landscape_regenerate', text="Regenerate", icon="LOOP_FORWARDS")
140 row = box.row(align=True)
141 split = row.split(align=True)
142 split.prop(ant, "smooth_mesh", toggle=True, text="Smooth", icon='SOLID')
143 split.prop(ant, "tri_face", toggle=True, text="Triangulate", icon='MESH_DATA')
144 if ant.sphere_mesh:
145 split.prop(ant, "remove_double", toggle=True, text="Remove Doubles", icon='MESH_DATA')
146 box.prop(ant, "ant_terrain_name")
147 box.prop_search(ant, "land_material", bpy.data, "materials")
148 col = box.column(align=True)
149 col.prop(ant, "subdivision_x")
150 col.prop(ant, "subdivision_y")
151 col = box.column(align=True)
152 if ant.sphere_mesh:
153 col.prop(ant, "mesh_size")
154 else:
155 col.prop(ant, "mesh_size_x")
156 col.prop(ant, "mesh_size_y")
159 # Landscape Noise Settings
160 class AntNoiseSettingsPanel(bpy.types.Panel):
161 bl_idname = "ANTNOISE_PT_layout"
162 bl_options = {'DEFAULT_CLOSED'}
163 bl_space_type = 'VIEW_3D'
164 bl_region_type = 'UI'
165 bl_context = "object"
166 bl_label = "Landscape Noise"
168 @classmethod
169 def poll(cls, context):
170 ob = bpy.context.active_object
171 return ob.ant_landscape.keys() if ob else False
173 def draw(self, context):
174 layout = self.layout
175 scene = context.scene
176 ob = bpy.context.active_object
177 ant = ob.ant_landscape
178 box = layout.box()
179 col = box.column(align=True)
180 col.scale_y = 1.5
181 if ant.sphere_mesh:
182 col.operator('mesh.ant_landscape_regenerate', text="Regenerate", icon="LOOP_FORWARDS")
183 else:
184 col.operator('mesh.ant_landscape_refresh', text="Refresh", icon="FILE_REFRESH")
186 box.prop(ant, "noise_type")
187 if ant.noise_type == "blender_texture":
188 box.prop_search(ant, "texture_block", bpy.data, "textures")
189 else:
190 box.prop(ant, "basis_type")
192 col = box.column(align=True)
193 col.prop(ant, "random_seed")
194 col = box.column(align=True)
195 col.prop(ant, "noise_offset_x")
196 col.prop(ant, "noise_offset_y")
197 if ant.sphere_mesh:
198 col.prop(ant, "noise_offset_z")
199 col.prop(ant, "noise_size_x")
200 col.prop(ant, "noise_size_y")
201 if ant.sphere_mesh:
202 col.prop(ant, "noise_size_z")
203 col = box.column(align=True)
204 col.prop(ant, "noise_size")
206 col = box.column(align=True)
207 if ant.noise_type == "multi_fractal":
208 col.prop(ant, "noise_depth")
209 col.prop(ant, "dimension")
210 col.prop(ant, "lacunarity")
211 elif ant.noise_type == "ridged_multi_fractal":
212 col.prop(ant, "noise_depth")
213 col.prop(ant, "dimension")
214 col.prop(ant, "lacunarity")
215 col.prop(ant, "offset")
216 col.prop(ant, "gain")
217 elif ant.noise_type == "hybrid_multi_fractal":
218 col.prop(ant, "noise_depth")
219 col.prop(ant, "dimension")
220 col.prop(ant, "lacunarity")
221 col.prop(ant, "offset")
222 col.prop(ant, "gain")
223 elif ant.noise_type == "hetero_terrain":
224 col.prop(ant, "noise_depth")
225 col.prop(ant, "dimension")
226 col.prop(ant, "lacunarity")
227 col.prop(ant, "offset")
228 elif ant.noise_type == "fractal":
229 col.prop(ant, "noise_depth")
230 col.prop(ant, "dimension")
231 col.prop(ant, "lacunarity")
232 elif ant.noise_type == "turbulence_vector":
233 col.prop(ant, "noise_depth")
234 col.prop(ant, "amplitude")
235 col.prop(ant, "frequency")
236 col.separator()
237 row = col.row(align=True)
238 row.prop(ant, "hard_noise", expand=True)
239 elif ant.noise_type == "variable_lacunarity":
240 box.prop(ant, "vl_basis_type")
241 box.prop(ant, "distortion")
242 elif ant.noise_type == "marble_noise":
243 box.prop(ant, "marble_shape")
244 box.prop(ant, "marble_bias")
245 box.prop(ant, "marble_sharp")
246 col = box.column(align=True)
247 col.prop(ant, "distortion")
248 col.prop(ant, "noise_depth")
249 col.separator()
250 row = col.row(align=True)
251 row.prop(ant, "hard_noise", expand=True)
252 elif ant.noise_type == "shattered_hterrain":
253 col.prop(ant, "noise_depth")
254 col.prop(ant, "dimension")
255 col.prop(ant, "lacunarity")
256 col.prop(ant, "offset")
257 col.prop(ant, "distortion")
258 elif ant.noise_type == "strata_hterrain":
259 col.prop(ant, "noise_depth")
260 col.prop(ant, "dimension")
261 col.prop(ant, "lacunarity")
262 col.prop(ant, "offset")
263 col.prop(ant, "distortion", text="Strata")
264 elif ant.noise_type == "ant_turbulence":
265 col.prop(ant, "noise_depth")
266 col.prop(ant, "amplitude")
267 col.prop(ant, "frequency")
268 col.prop(ant, "distortion")
269 col.separator()
270 row = col.row(align=True)
271 row.prop(ant, "hard_noise", expand=True)
272 elif ant.noise_type == "vl_noise_turbulence":
273 col.prop(ant, "noise_depth")
274 col.prop(ant, "amplitude")
275 col.prop(ant, "frequency")
276 col.prop(ant, "distortion")
277 col.separator()
278 box.prop(ant, "vl_basis_type")
279 col.separator()
280 row = col.row(align=True)
281 row.prop(ant, "hard_noise", expand=True)
282 elif ant.noise_type == "vl_hTerrain":
283 col.prop(ant, "noise_depth")
284 col.prop(ant, "dimension")
285 col.prop(ant, "lacunarity")
286 col.prop(ant, "offset")
287 col.prop(ant, "distortion")
288 col.separator()
289 box.prop(ant, "vl_basis_type")
290 elif ant.noise_type == "distorted_heteroTerrain":
291 col.prop(ant, "noise_depth")
292 col.prop(ant, "dimension")
293 col.prop(ant, "lacunarity")
294 col.prop(ant, "offset")
295 col.prop(ant, "distortion")
296 col.separator()
297 col.prop(ant, "vl_basis_type")
298 elif ant.noise_type == "double_multiFractal":
299 col.prop(ant, "noise_depth")
300 col.prop(ant, "dimension")
301 col.prop(ant, "lacunarity")
302 col.prop(ant, "offset")
303 col.prop(ant, "gain")
304 col.separator()
305 box.prop(ant, "vl_basis_type")
306 elif ant.noise_type == "rocks_noise":
307 col.prop(ant, "noise_depth")
308 col.prop(ant, "distortion")
309 col.separator()
310 row = col.row(align=True)
311 row.prop(ant, "hard_noise", expand=True)
312 elif ant.noise_type == "slick_rock":
313 col.prop(ant, "noise_depth")
314 col.prop(ant, "dimension")
315 col.prop(ant, "lacunarity")
316 col.prop(ant, "gain")
317 col.prop(ant, "offset")
318 col.prop(ant, "distortion")
319 col.separator()
320 box.prop(ant, "vl_basis_type")
321 elif ant.noise_type == "planet_noise":
322 col.prop(ant, "noise_depth")
323 col.separator()
324 row = col.row(align=True)
325 row.prop(ant, "hard_noise", expand=True)
327 # Effects mix
328 col = box.column(align=False)
329 box.prop(ant, "fx_type")
330 if ant.fx_type != "0":
331 if int(ant.fx_type) <= 12:
332 box.prop(ant, "fx_bias")
334 box.prop(ant, "fx_mix_mode")
335 col = box.column(align=True)
336 col.prop(ant, "fx_mixfactor")
338 col = box.column(align=True)
339 col.prop(ant, "fx_loc_x")
340 col.prop(ant, "fx_loc_y")
341 col.prop(ant, "fx_size")
343 col = box.column(align=True)
344 col.prop(ant, "fx_depth")
345 if ant.fx_depth != 0:
346 col.prop(ant, "fx_frequency")
347 col.prop(ant, "fx_amplitude")
348 col.prop(ant, "fx_turb")
350 col = box.column(align=True)
351 row = col.row(align=True).split(0.92, align=True)
352 row.prop(ant, "fx_height")
353 row.prop(ant, "fx_invert", toggle=True, text="", icon='ARROW_LEFTRIGHT')
354 col.prop(ant, "fx_offset")
357 # Landscape Displace Settings
358 class AntDisplaceSettingsPanel(bpy.types.Panel):
359 bl_idname = "ANTDISP_PT_layout"
360 bl_options = {'DEFAULT_CLOSED'}
361 bl_space_type = 'VIEW_3D'
362 bl_region_type = 'UI'
363 bl_context = "object"
364 bl_label = "Landscape Displace"
366 @classmethod
367 def poll(cls, context):
368 ob = bpy.context.active_object
369 return ob.ant_landscape.keys() if ob else False
371 def draw(self, context):
372 layout = self.layout
373 scene = context.scene
374 ob = bpy.context.active_object
375 ant = ob.ant_landscape
376 box = layout.box()
377 col = box.column(align=True)
378 col.scale_y = 1.5
379 if ant.sphere_mesh:
380 col.operator('mesh.ant_landscape_regenerate', text="Regenerate", icon="LOOP_FORWARDS")
381 else:
382 col.operator('mesh.ant_landscape_refresh', text="Refresh", icon="FILE_REFRESH")
384 col = box.column(align=True)
385 row = col.row(align=True).split(0.92, align=True)
386 row.prop(ant, "height")
387 row.prop(ant, "height_invert", toggle=True, text="", icon='ARROW_LEFTRIGHT')
388 col.prop(ant, "height_offset")
389 col.prop(ant, "maximum")
390 col.prop(ant, "minimum")
391 if not ant.sphere_mesh:
392 col = box.column()
393 col.prop(ant, "edge_falloff")
394 if ant.edge_falloff is not "0":
395 col = box.column(align=True)
396 col.prop(ant, "edge_level")
397 if ant.edge_falloff in ["2", "3"]:
398 col.prop(ant, "falloff_x")
399 if ant.edge_falloff in ["1", "3"]:
400 col.prop(ant, "falloff_y")
402 col = box.column()
403 col.prop(ant, "strata_type")
404 if ant.strata_type is not "0":
405 col = box.column()
406 col.prop(ant, "strata")
407 col = box.column()
408 col.prop_search(ant, "vert_group", ob, "vertex_groups")
411 # ------------------------------------------------------------
412 # Properties group
413 class AntLandscapePropertiesGroup(bpy.types.PropertyGroup):
415 ant_terrain_name = StringProperty(
416 name="Name",
417 default="Landscape"
419 land_material = StringProperty(
420 name='Material',
421 default="",
422 description="Terrain material"
424 water_material = StringProperty(
425 name='Material',
426 default="",
427 description="Water plane material"
429 texture_block = StringProperty(
430 name="Texture",
431 default=""
433 at_cursor = BoolProperty(
434 name="Cursor",
435 default=True,
436 description="Place at cursor location",
438 smooth_mesh = BoolProperty(
439 name="Smooth",
440 default=True,
441 description="Shade smooth"
443 tri_face = BoolProperty(
444 name="Triangulate",
445 default=False,
446 description="Triangulate faces"
448 sphere_mesh = BoolProperty(
449 name="Sphere",
450 default=False,
451 description="Generate uv sphere - remove doubles when ready"
453 subdivision_x = IntProperty(
454 name="Subdivisions X",
455 default=128,
456 min=4,
457 max=6400,
458 description="Mesh X subdivisions"
460 subdivision_y = IntProperty(
461 default=128,
462 name="Subdivisions Y",
463 min=4,
464 max=6400,
465 description="Mesh Y subdivisions"
467 mesh_size = FloatProperty(
468 default=2.0,
469 name="Mesh Size",
470 min=0.01,
471 max=100000.0,
472 description="Mesh size"
474 mesh_size_x = FloatProperty(
475 default=2.0,
476 name="Mesh Size X",
477 min=0.01,
478 description="Mesh x size"
480 mesh_size_y = FloatProperty(
481 name="Mesh Size Y",
482 default=2.0,
483 min=0.01,
484 description="Mesh y size"
487 random_seed = IntProperty(
488 name="Random Seed",
489 default=0,
490 min=0,
491 description="Randomize noise origin"
493 noise_offset_x = FloatProperty(
494 name="Offset X",
495 default=0.0,
496 description="Noise X Offset"
498 noise_offset_y = FloatProperty(
499 name="Offset Y",
500 default=0.0,
501 description="Noise Y Offset"
503 noise_offset_z = FloatProperty(
504 name="Offset Z",
505 default=0.0,
506 description="Noise Z Offset"
508 noise_size_x = FloatProperty(
509 default=1.0,
510 name="Size X",
511 min=0.01,
512 max=1000.0,
513 description="Noise x size"
515 noise_size_y = FloatProperty(
516 name="Size Y",
517 default=1.0,
518 min=0.01,
519 max=1000.0,
520 description="Noise y size"
522 noise_size_z = FloatProperty(
523 name="Size Z",
524 default=1.0,
525 min=0.01,
526 max=1000.0,
527 description="Noise Z size"
529 noise_size = FloatProperty(
530 name="Noise Size",
531 default=1.0,
532 min=0.01,
533 max=1000.0,
534 description="Noise size"
536 noise_type = EnumProperty(
537 name="Noise Type",
538 default='hetero_terrain',
539 description="Noise type",
540 items = [
541 ('multi_fractal', "Multi Fractal", "Blender: Multi Fractal algorithm", 0),
542 ('ridged_multi_fractal', "Ridged MFractal", "Blender: Ridged Multi Fractal", 1),
543 ('hybrid_multi_fractal', "Hybrid MFractal", "Blender: Hybrid Multi Fractal", 2),
544 ('hetero_terrain', "Hetero Terrain", "Blender: Hetero Terrain", 3),
545 ('fractal', "fBm Fractal", "Blender: fBm - Fractional Browninian motion", 4),
546 ('turbulence_vector', "Turbulence", "Blender: Turbulence Vector", 5),
547 ('variable_lacunarity', "Distorted Noise", "Blender: Distorted Noise", 6),
548 ('marble_noise', "Marble", "A.N.T.: Marble Noise", 7),
549 ('shattered_hterrain', "Shattered hTerrain", "A.N.T.: Shattered hTerrain", 8),
550 ('strata_hterrain', "Strata hTerrain", "A.N.T: Strata hTerrain", 9),
551 ('ant_turbulence', "Another Noise", "A.N.T: Turbulence variation", 10),
552 ('vl_noise_turbulence', "vlNoise turbulence", "A.N.T: Real vlNoise turbulence", 11),
553 ('vl_hTerrain', "vlNoise hTerrain", "A.N.T: vlNoise hTerrain", 12),
554 ('distorted_heteroTerrain', "Distorted hTerrain", "A.N.T distorted hTerrain", 13),
555 ('double_multiFractal', "Double MultiFractal", "A.N.T: double multiFractal", 14),
556 ('rocks_noise', "Noise Rocks", "A.N.T: turbulence variation", 15),
557 ('slick_rock', "Slick Rock", "A.N.T: slick rock", 16),
558 ('planet_noise', "Planet Noise", "Planet Noise by: Farsthary", 17),
559 ('blender_texture', "Blender Texture - Texture Nodes", "Blender texture data block", 18)]
561 basis_type = EnumProperty(
562 name="Noise Basis",
563 default="0",
564 description="Noise basis algorithms",
565 items = [
566 ("0", "Blender", "Blender default noise", 0),
567 ("1", "Perlin", "Perlin noise", 1),
568 ("2", "New Perlin", "New Perlin noise", 2),
569 ("3", "Voronoi F1", "Voronoi F1", 3),
570 ("4", "Voronoi F2", "Voronoi F2", 4),
571 ("5", "Voronoi F3", "Voronoi F3", 5),
572 ("6", "Voronoi F4", "Voronoi F4", 6),
573 ("7", "Voronoi F2-F1", "Voronoi F2-F1", 7),
574 ("8", "Voronoi Crackle", "Voronoi Crackle", 8),
575 ("9", "Cell Noise", "Cell noise", 9)]
577 vl_basis_type = EnumProperty(
578 name="vlNoise Basis",
579 default="0",
580 description="VLNoise basis algorithms",
581 items = [
582 ("0", "Blender", "Blender default noise", 0),
583 ("1", "Perlin", "Perlin noise", 1),
584 ("2", "New Perlin", "New Perlin noise", 2),
585 ("3", "Voronoi F1", "Voronoi F1", 3),
586 ("4", "Voronoi F2", "Voronoi F2", 4),
587 ("5", "Voronoi F3", "Voronoi F3", 5),
588 ("6", "Voronoi F4", "Voronoi F4", 6),
589 ("7", "Voronoi F2-F1", "Voronoi F2-F1", 7),
590 ("8", "Voronoi Crackle", "Voronoi Crackle", 8),
591 ("9", "Cell Noise", "Cell noise", 9)]
593 distortion = FloatProperty(
594 name="Distortion",
595 default=1.0,
596 min=0.01,
597 max=100.0,
598 description="Distortion amount"
600 hard_noise = EnumProperty(
601 name="Soft Hard",
602 default="0",
603 description="Soft Noise, Hard noise",
604 items = [
605 ("0", "Soft", "Soft Noise", 0),
606 ("1", "Hard", "Hard noise", 1)]
608 noise_depth = IntProperty(
609 name="Depth",
610 default=8,
611 min=0,
612 max=16,
613 description="Noise Depth - number of frequencies in the fBm"
615 amplitude = FloatProperty(
616 name="Amp",
617 default=0.5,
618 min=0.01,
619 max=1.0,
620 description="Amplitude"
622 frequency = FloatProperty(
623 name="Freq",
624 default=2.0,
625 min=0.01,
626 max=5.0,
627 description="Frequency"
629 dimension = FloatProperty(
630 name="Dimension",
631 default=1.0,
632 min=0.01,
633 max=2.0,
634 description="H - fractal dimension of the roughest areas"
636 lacunarity = FloatProperty(
637 name="Lacunarity",
638 min=0.01,
639 max=6.0,
640 default=2.0,
641 description="Lacunarity - gap between successive frequencies"
643 offset = FloatProperty(
644 name="Offset",
645 default=1.0,
646 min=0.01,
647 max=6.0,
648 description="Offset - raises the terrain from sea level"
650 gain = FloatProperty(
651 name="Gain",
652 default=1.0,
653 min=0.01,
654 max=6.0,
655 description="Gain - scale factor"
657 marble_bias = EnumProperty(
658 name="Bias",
659 default="0",
660 description="Marble bias",
661 items = [
662 ("0", "Sin", "Sin", 0),
663 ("1", "Cos", "Cos", 1),
664 ("2", "Tri", "Tri", 2),
665 ("3", "Saw", "Saw", 3)]
667 marble_sharp = EnumProperty(
668 name="Sharp",
669 default="0",
670 description="Marble sharpness",
671 items = [
672 ("0", "Soft", "Soft", 0),
673 ("1", "Sharp", "Sharp", 1),
674 ("2", "Sharper", "Sharper", 2),
675 ("3", "Soft inv.", "Soft", 3),
676 ("4", "Sharp inv.", "Sharp", 4),
677 ("5", "Sharper inv.", "Sharper", 5)]
679 marble_shape = EnumProperty(
680 name="Shape",
681 default="0",
682 description="Marble shape",
683 items= [
684 ("0", "Default", "Default", 0),
685 ("1", "Ring", "Ring", 1),
686 ("2", "Swirl", "Swirl", 2),
687 ("3", "Bump", "Bump", 3),
688 ("4", "Wave", "Wave", 4),
689 ("5", "Z", "Z", 5),
690 ("6", "Y", "Y", 6),
691 ("7", "X", "X", 7)]
693 height = FloatProperty(
694 name="Height",
695 default=0.5,
696 min=-10000.0,
697 max=10000.0,
698 description="Noise intensity scale"
700 height_invert = BoolProperty(
701 name="Invert",
702 default=False,
703 description="Height invert",
705 height_offset = FloatProperty(
706 name="Offset",
707 default=0.0,
708 min=-10000.0,
709 max=10000.0,
710 description="Height offset"
712 fx_mixfactor = FloatProperty(
713 name="Mix Factor",
714 default=0.0,
715 min=-1.0,
716 max=1.0,
717 description="Effect mix factor: -1.0 = Noise, +1.0 = Effect"
719 fx_mix_mode = EnumProperty(
720 name="Effect Mix",
721 default="0",
722 description="Effect mix mode",
723 items = [
724 ("0", "Mix", "Mix", 0),
725 ("1", "Add", "Add", 1),
726 ("2", "Sub", "Subtract", 2),
727 ("3", "Mul", "Multiply", 3),
728 ("4", "Abs", "Absolute", 4),
729 ("5", "Scr", "Screen", 5),
730 ("6", "Mod", "Modulo", 6),
731 ("7", "Min", "Minimum", 7),
732 ("8", "Max", "Maximum", 8)
735 fx_type = EnumProperty(
736 name="Effect Type",
737 default="0",
738 description="Effect type",
739 items = [
740 ("0", "None", "No effect", 0),
741 ("1", "Gradient", "Gradient", 1),
742 ("2", "Waves", "Waves - Bumps", 2),
743 ("3", "Zigzag", "Zigzag", 3),
744 ("4", "Wavy", "Wavy", 4),
745 ("5", "Bump", "Bump", 5),
746 ("6", "Dots", "Dots", 6),
747 ("7", "Rings", "Rings", 7),
748 ("8", "Spiral", "Spiral", 8),
749 ("9", "Square", "Square", 9),
750 ("10", "Blocks", "Blocks", 10),
751 ("11", "Grid", "Grid", 11),
752 ("12", "Tech", "Tech", 12),
753 ("13", "Crackle", "Crackle", 13),
754 ("14", "Cracks", "Cracks", 14),
755 ("15", "Rock", "Rock noise", 15),
756 ("16", "Lunar", "Craters", 16),
757 ("17", "Cosine", "Cosine", 17),
758 ("18", "Spikey", "Spikey", 18),
759 ("19", "Stone", "Stone", 19),
760 ("20", "Flat Turb", "Flat turbulence", 20),
761 ("21", "Flat Voronoi", "Flat voronoi", 21)
764 fx_bias = EnumProperty(
765 name="Effect Bias",
766 default="0",
767 description="Effect bias type",
768 items = [
769 ("0", "Sin", "Sin", 0),
770 ("1", "Cos", "Cos", 1),
771 ("2", "Tri", "Tri", 2),
772 ("3", "Saw", "Saw", 3),
773 ("4", "None", "None", 4)]
775 fx_turb = FloatProperty(
776 name="Distortion",
777 default=0.0,
778 min=0.0,
779 max=1000.0,
780 description="Effect turbulence distortion"
782 fx_depth = IntProperty(
783 name="Depth",
784 default=0,
785 min=0,
786 max=16,
787 description="Effect depth - number of frequencies"
789 fx_amplitude = FloatProperty(
790 name="Amp",
791 default=0.5,
792 min=0.01,
793 max=1.0,
794 description="Amplitude"
796 fx_frequency = FloatProperty(
797 name="Freq",
798 default=2.0,
799 min=0.01,
800 max=5.0,
801 description="Frequency"
803 fx_size = FloatProperty(
804 name="Effect Size",
805 default=1.0,
806 min=0.01,
807 max=1000.0,
808 description="Effect size"
810 fx_loc_x = FloatProperty(
811 name="Offset X",
812 default=0.0,
813 description="Effect x offset"
815 fx_loc_y = FloatProperty(
816 name="Offset Y",
817 default=0.0,
818 description="Effect y offset"
820 fx_height = FloatProperty(
821 name="Intensity",
822 default=1.0,
823 min=-1000.0,
824 max=1000.0,
825 description="Effect intensity scale"
827 fx_invert = BoolProperty(
828 name="Invert",
829 default=False,
830 description="Effect invert"
832 fx_offset = FloatProperty(
833 name="Offset",
834 default=0.0,
835 min=-1000.0,
836 max=1000.0,
837 description="Effect height offset"
840 edge_falloff = EnumProperty(
841 name="Falloff",
842 default="3",
843 description="Flatten edges",
844 items = [
845 ("0", "None", "None", 0),
846 ("1", "Y", "Y Falloff", 1),
847 ("2", "X", "X Falloff", 2),
848 ("3", "X Y", "X Y Falloff", 3)]
850 falloff_x = FloatProperty(
851 name="Falloff X",
852 default=4.0,
853 min=0.1,
854 max=100.0,
855 description="Falloff x scale"
857 falloff_y = FloatProperty(
858 name="Falloff Y",
859 default=4.0,
860 min=0.1,
861 max=100.0,
862 description="Falloff y scale"
864 edge_level = FloatProperty(
865 name="Edge Level",
866 default=0.0,
867 min=-10000.0,
868 max=10000.0,
869 description="Edge level, sealevel offset"
871 maximum = FloatProperty(
872 name="Maximum",
873 default=1.0,
874 min=-10000.0,
875 max=10000.0,
876 description="Maximum, flattens terrain at plateau level"
878 minimum = FloatProperty(
879 name="Minimum",
880 default=-1.0,
881 min=-10000.0,
882 max=10000.0,
883 description="Minimum, flattens terrain at seabed level"
885 vert_group = StringProperty(
886 name="Vertex Group",
887 default=""
889 strata = FloatProperty(
890 name="Amount",
891 default=5.0,
892 min=0.01,
893 max=1000.0,
894 description="Strata layers / terraces"
896 strata_type = EnumProperty(
897 name="Strata",
898 default="0",
899 description="Strata types",
900 items = [
901 ("0", "None", "No strata", 0),
902 ("1", "Smooth", "Smooth transitions", 1),
903 ("2", "Sharp Sub", "Sharp subtract transitions", 2),
904 ("3", "Sharp Add", "Sharp add transitions", 3),
905 ("4", "Quantize", "Quantize", 4),
906 ("5", "Quantize Mix", "Quantize mixed", 5)]
908 water_plane = BoolProperty(
909 name="Water Plane",
910 default=False,
911 description="Add water plane"
913 water_level = FloatProperty(
914 name="Level",
915 default=0.01,
916 min=-10000.0,
917 max=10000.0,
918 description="Water level"
920 remove_double = BoolProperty(
921 name="Remove Doubles",
922 default=False,
923 description="Remove doubles"
925 refresh = BoolProperty(
926 name="Refresh",
927 default=False,
928 description="Refresh"
930 auto_refresh = BoolProperty(
931 name="Auto",
932 default=True,
933 description="Automatic refresh"
936 # ------------------------------------------------------------
937 # Register:
939 def register():
940 bpy.utils.register_module(__name__)
941 bpy.types.VIEW3D_MT_mesh_add.append(menu_func_landscape)
942 bpy.types.Object.ant_landscape = PointerProperty(type=AntLandscapePropertiesGroup, name="ANT_Landscape", description="Landscape properties")
943 bpy.types.VIEW3D_MT_paint_weight.append(menu_func_eroder)
946 def unregister():
947 bpy.utils.unregister_module(__name__)
948 bpy.types.VIEW3D_MT_mesh_add.remove(menu_func_landscape)
949 bpy.types.VIEW3D_MT_paint_weight.remove(menu_func_eroder)
952 if __name__ == "__main__":
953 register()