Update 'bl_info' use 'doc_url' instead of 'wiki_url'
[blender-addons.git] / ant_landscape / __init__.py
blob5af0d261738db28b46e637ad366502fb372fb06d
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, 80, 0),
27 "location": "View3D > Sidebar > Create Tab",
28 "description": "Another Noise Tool: Landscape and Displace",
29 "warning": "",
30 "doc_url": "https://docs.blender.org/manual/en/dev/addons/"
31 "add_mesh/ant_landscape.html",
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 layout = self.layout
75 layout.separator()
76 self.layout.operator('mesh.landscape_add', text="Landscape", icon="RNDCURVE")
79 # Landscape Add Panel
80 class AntLandscapeAddPanel(bpy.types.Panel):
81 bl_category = "Create"
82 bl_label = "Landscape"
83 bl_idname = "ANTLANDSCAPE_PT_add"
84 bl_space_type = "VIEW_3D"
85 bl_region_type = "UI"
86 bl_context = "objectmode"
87 bl_options = {'DEFAULT_CLOSED'}
89 def draw(self, context):
90 col = self.layout.column()
91 col.operator('mesh.landscape_add', text="Landscape", icon="RNDCURVE")
94 # Landscape Tools:
95 class AntLandscapeToolsPanel(bpy.types.Panel):
96 bl_category = "Create"
97 bl_label = "Landscape Tools"
98 bl_idname = "ANTLANDSCAPE_PT_tools"
99 bl_space_type = "VIEW_3D"
100 bl_region_type = "UI"
101 bl_context = "objectmode"
102 bl_options = {'DEFAULT_CLOSED'}
104 @classmethod
105 def poll(cls, context):
106 ob = bpy.context.active_object
107 return (ob and ob.type == 'MESH')
109 def draw(self, context):
110 layout = self.layout
111 ob = context.active_object
112 col = layout.column()
113 col.operator('mesh.ant_displace', text="Mesh Displace", icon="RNDCURVE")
114 col.operator('mesh.ant_slope_map', icon='GROUP_VERTEX')
115 if ob.ant_landscape.keys() and not ob.ant_landscape['sphere_mesh']:
116 col.operator('mesh.eroder', text="Landscape Eroder", icon='SMOOTHCURVE')
119 # Landscape Main Settings
120 class AntMainSettingsPanel(bpy.types.Panel):
121 bl_category = "Create"
122 bl_label = "Landscape Main"
123 bl_idname = "ANTLANDSCAPE_PT_main"
124 bl_space_type = "VIEW_3D"
125 bl_region_type = "UI"
126 bl_options = {'DEFAULT_CLOSED'}
128 @classmethod
129 def poll(cls, context):
130 ob = bpy.context.active_object
131 return ob.ant_landscape.keys() if ob else False
133 def draw(self, context):
134 layout = self.layout
135 scene = context.scene
136 ob = bpy.context.active_object
137 ant = ob.ant_landscape
138 box = layout.box()
139 col = box.column(align=False)
140 col.scale_y = 1.5
141 col.operator('mesh.ant_landscape_regenerate', text="Regenerate", icon="LOOP_FORWARDS")
142 row = box.row(align=True)
143 split = row.split(align=True)
144 split.prop(ant, "smooth_mesh", toggle=True, text="Smooth", icon='SHADING_SOLID')
145 split.prop(ant, "tri_face", toggle=True, text="Triangulate", icon='MESH_DATA')
146 if ant.sphere_mesh:
147 split.prop(ant, "remove_double", toggle=True, text="Remove Doubles", icon='MESH_DATA')
148 box.prop(ant, "ant_terrain_name")
149 box.prop_search(ant, "land_material", bpy.data, "materials")
150 col = box.column(align=True)
151 col.prop(ant, "subdivision_x")
152 col.prop(ant, "subdivision_y")
153 col = box.column(align=True)
154 if ant.sphere_mesh:
155 col.prop(ant, "mesh_size")
156 else:
157 col.prop(ant, "mesh_size_x")
158 col.prop(ant, "mesh_size_y")
161 # Landscape Noise Settings
162 class AntNoiseSettingsPanel(bpy.types.Panel):
163 bl_category = "Create"
164 bl_label = "Landscape Noise"
165 bl_idname = "ANTLANDSCAPE_PT_noise"
166 bl_space_type = "VIEW_3D"
167 bl_region_type = "UI"
168 bl_options = {'DEFAULT_CLOSED'}
170 @classmethod
171 def poll(cls, context):
172 ob = bpy.context.active_object
173 return ob.ant_landscape.keys() if ob else False
175 def draw(self, context):
176 layout = self.layout
177 scene = context.scene
178 ob = bpy.context.active_object
179 ant = ob.ant_landscape
180 box = layout.box()
181 col = box.column(align=True)
182 col.scale_y = 1.5
183 if ant.sphere_mesh:
184 col.operator('mesh.ant_landscape_regenerate', text="Regenerate", icon="LOOP_FORWARDS")
185 else:
186 col.operator('mesh.ant_landscape_refresh', text="Refresh", icon="FILE_REFRESH")
188 box.prop(ant, "noise_type")
189 if ant.noise_type == "blender_texture":
190 box.prop_search(ant, "texture_block", bpy.data, "textures")
191 else:
192 box.prop(ant, "basis_type")
194 col = box.column(align=True)
195 col.prop(ant, "random_seed")
196 col = box.column(align=True)
197 col.prop(ant, "noise_offset_x")
198 col.prop(ant, "noise_offset_y")
199 if ant.sphere_mesh:
200 col.prop(ant, "noise_offset_z")
201 col.prop(ant, "noise_size_x")
202 col.prop(ant, "noise_size_y")
203 if ant.sphere_mesh:
204 col.prop(ant, "noise_size_z")
205 col = box.column(align=True)
206 col.prop(ant, "noise_size")
208 col = box.column(align=True)
209 if ant.noise_type == "multi_fractal":
210 col.prop(ant, "noise_depth")
211 col.prop(ant, "dimension")
212 col.prop(ant, "lacunarity")
213 elif ant.noise_type == "ridged_multi_fractal":
214 col.prop(ant, "noise_depth")
215 col.prop(ant, "dimension")
216 col.prop(ant, "lacunarity")
217 col.prop(ant, "offset")
218 col.prop(ant, "gain")
219 elif ant.noise_type == "hybrid_multi_fractal":
220 col.prop(ant, "noise_depth")
221 col.prop(ant, "dimension")
222 col.prop(ant, "lacunarity")
223 col.prop(ant, "offset")
224 col.prop(ant, "gain")
225 elif ant.noise_type == "hetero_terrain":
226 col.prop(ant, "noise_depth")
227 col.prop(ant, "dimension")
228 col.prop(ant, "lacunarity")
229 col.prop(ant, "offset")
230 elif ant.noise_type == "fractal":
231 col.prop(ant, "noise_depth")
232 col.prop(ant, "dimension")
233 col.prop(ant, "lacunarity")
234 elif ant.noise_type == "turbulence_vector":
235 col.prop(ant, "noise_depth")
236 col.prop(ant, "amplitude")
237 col.prop(ant, "frequency")
238 col.separator()
239 row = col.row(align=True)
240 row.prop(ant, "hard_noise", expand=True)
241 elif ant.noise_type == "variable_lacunarity":
242 box.prop(ant, "vl_basis_type")
243 box.prop(ant, "distortion")
244 elif ant.noise_type == "marble_noise":
245 box.prop(ant, "marble_shape")
246 box.prop(ant, "marble_bias")
247 box.prop(ant, "marble_sharp")
248 col = box.column(align=True)
249 col.prop(ant, "distortion")
250 col.prop(ant, "noise_depth")
251 col.separator()
252 row = col.row(align=True)
253 row.prop(ant, "hard_noise", expand=True)
254 elif ant.noise_type == "shattered_hterrain":
255 col.prop(ant, "noise_depth")
256 col.prop(ant, "dimension")
257 col.prop(ant, "lacunarity")
258 col.prop(ant, "offset")
259 col.prop(ant, "distortion")
260 elif ant.noise_type == "strata_hterrain":
261 col.prop(ant, "noise_depth")
262 col.prop(ant, "dimension")
263 col.prop(ant, "lacunarity")
264 col.prop(ant, "offset")
265 col.prop(ant, "distortion", text="Strata")
266 elif ant.noise_type == "ant_turbulence":
267 col.prop(ant, "noise_depth")
268 col.prop(ant, "amplitude")
269 col.prop(ant, "frequency")
270 col.prop(ant, "distortion")
271 col.separator()
272 row = col.row(align=True)
273 row.prop(ant, "hard_noise", expand=True)
274 elif ant.noise_type == "vl_noise_turbulence":
275 col.prop(ant, "noise_depth")
276 col.prop(ant, "amplitude")
277 col.prop(ant, "frequency")
278 col.prop(ant, "distortion")
279 col.separator()
280 box.prop(ant, "vl_basis_type")
281 col.separator()
282 row = col.row(align=True)
283 row.prop(ant, "hard_noise", expand=True)
284 elif ant.noise_type == "vl_hTerrain":
285 col.prop(ant, "noise_depth")
286 col.prop(ant, "dimension")
287 col.prop(ant, "lacunarity")
288 col.prop(ant, "offset")
289 col.prop(ant, "distortion")
290 col.separator()
291 box.prop(ant, "vl_basis_type")
292 elif ant.noise_type == "distorted_heteroTerrain":
293 col.prop(ant, "noise_depth")
294 col.prop(ant, "dimension")
295 col.prop(ant, "lacunarity")
296 col.prop(ant, "offset")
297 col.prop(ant, "distortion")
298 col.separator()
299 col.prop(ant, "vl_basis_type")
300 elif ant.noise_type == "double_multiFractal":
301 col.prop(ant, "noise_depth")
302 col.prop(ant, "dimension")
303 col.prop(ant, "lacunarity")
304 col.prop(ant, "offset")
305 col.prop(ant, "gain")
306 col.separator()
307 box.prop(ant, "vl_basis_type")
308 elif ant.noise_type == "rocks_noise":
309 col.prop(ant, "noise_depth")
310 col.prop(ant, "distortion")
311 col.separator()
312 row = col.row(align=True)
313 row.prop(ant, "hard_noise", expand=True)
314 elif ant.noise_type == "slick_rock":
315 col.prop(ant, "noise_depth")
316 col.prop(ant, "dimension")
317 col.prop(ant, "lacunarity")
318 col.prop(ant, "gain")
319 col.prop(ant, "offset")
320 col.prop(ant, "distortion")
321 col.separator()
322 box.prop(ant, "vl_basis_type")
323 elif ant.noise_type == "planet_noise":
324 col.prop(ant, "noise_depth")
325 col.separator()
326 row = col.row(align=True)
327 row.prop(ant, "hard_noise", expand=True)
329 # Effects mix
330 col = box.column(align=False)
331 box.prop(ant, "fx_type")
332 if ant.fx_type != "0":
333 if int(ant.fx_type) <= 12:
334 box.prop(ant, "fx_bias")
336 box.prop(ant, "fx_mix_mode")
337 col = box.column(align=True)
338 col.prop(ant, "fx_mixfactor")
340 col = box.column(align=True)
341 col.prop(ant, "fx_loc_x")
342 col.prop(ant, "fx_loc_y")
343 col.prop(ant, "fx_size")
345 col = box.column(align=True)
346 col.prop(ant, "fx_depth")
347 if ant.fx_depth != 0:
348 col.prop(ant, "fx_frequency")
349 col.prop(ant, "fx_amplitude")
350 col.prop(ant, "fx_turb")
352 col = box.column(align=True)
353 row = col.row(align=True).split(factor=0.92, align=True)
354 row.prop(ant, "fx_height")
355 row.prop(ant, "fx_invert", toggle=True, text="", icon='ARROW_LEFTRIGHT')
356 col.prop(ant, "fx_offset")
359 # Landscape Displace Settings
360 class AntDisplaceSettingsPanel(bpy.types.Panel):
361 bl_category = "Create"
362 bl_label = "Landscape Displace"
363 bl_idname = "ANTLANDSCAPE_PT_disp"
364 bl_space_type = "VIEW_3D"
365 bl_region_type = "UI"
366 bl_options = {'DEFAULT_CLOSED'}
368 @classmethod
369 def poll(cls, context):
370 ob = bpy.context.active_object
371 return ob.ant_landscape.keys() if ob else False
373 def draw(self, context):
374 layout = self.layout
375 scene = context.scene
376 ob = bpy.context.active_object
377 ant = ob.ant_landscape
378 box = layout.box()
379 col = box.column(align=True)
380 col.scale_y = 1.5
381 if ant.sphere_mesh:
382 col.operator('mesh.ant_landscape_regenerate', text="Regenerate", icon="LOOP_FORWARDS")
383 else:
384 col.operator('mesh.ant_landscape_refresh', text="Refresh", icon="FILE_REFRESH")
386 col = box.column(align=True)
387 row = col.row(align=True).split(factor=0.92, align=True)
388 row.prop(ant, "height")
389 row.prop(ant, "height_invert", toggle=True, text="", icon='ARROW_LEFTRIGHT')
390 col.prop(ant, "height_offset")
391 col.prop(ant, "maximum")
392 col.prop(ant, "minimum")
393 if not ant.sphere_mesh:
394 col = box.column()
395 col.prop(ant, "edge_falloff")
396 if ant.edge_falloff != "0":
397 col = box.column(align=True)
398 col.prop(ant, "edge_level")
399 if ant.edge_falloff in ["2", "3"]:
400 col.prop(ant, "falloff_x")
401 if ant.edge_falloff in ["1", "3"]:
402 col.prop(ant, "falloff_y")
404 col = box.column()
405 col.prop(ant, "strata_type")
406 if ant.strata_type != "0":
407 col = box.column()
408 col.prop(ant, "strata")
409 col = box.column()
410 col.prop_search(ant, "vert_group", ob, "vertex_groups")
413 # ------------------------------------------------------------
414 # Properties group
415 class AntLandscapePropertiesGroup(bpy.types.PropertyGroup):
417 ant_terrain_name: StringProperty(
418 name="Name",
419 default="Landscape"
421 land_material: StringProperty(
422 name='Material',
423 default="",
424 description="Terrain material"
426 water_material: StringProperty(
427 name='Material',
428 default="",
429 description="Water plane material"
431 texture_block: StringProperty(
432 name="Texture",
433 default=""
435 at_cursor: BoolProperty(
436 name="Cursor",
437 default=True,
438 description="Place at cursor location",
440 smooth_mesh: BoolProperty(
441 name="Smooth",
442 default=True,
443 description="Shade smooth"
445 tri_face: BoolProperty(
446 name="Triangulate",
447 default=False,
448 description="Triangulate faces"
450 sphere_mesh: BoolProperty(
451 name="Sphere",
452 default=False,
453 description="Generate uv sphere - remove doubles when ready"
455 subdivision_x: IntProperty(
456 name="Subdivisions X",
457 default=128,
458 min=4,
459 max=6400,
460 description="Mesh X subdivisions"
462 subdivision_y: IntProperty(
463 default=128,
464 name="Subdivisions Y",
465 min=4,
466 max=6400,
467 description="Mesh Y subdivisions"
469 mesh_size: FloatProperty(
470 default=2.0,
471 name="Mesh Size",
472 min=0.01,
473 max=100000.0,
474 description="Mesh size"
476 mesh_size_x: FloatProperty(
477 default=2.0,
478 name="Mesh Size X",
479 min=0.01,
480 description="Mesh x size"
482 mesh_size_y: FloatProperty(
483 name="Mesh Size Y",
484 default=2.0,
485 min=0.01,
486 description="Mesh y size"
489 random_seed: IntProperty(
490 name="Random Seed",
491 default=0,
492 min=0,
493 description="Randomize noise origin"
495 noise_offset_x: FloatProperty(
496 name="Offset X",
497 default=0.0,
498 description="Noise X Offset"
500 noise_offset_y: FloatProperty(
501 name="Offset Y",
502 default=0.0,
503 description="Noise Y Offset"
505 noise_offset_z: FloatProperty(
506 name="Offset Z",
507 default=0.0,
508 description="Noise Z Offset"
510 noise_size_x: FloatProperty(
511 default=1.0,
512 name="Size X",
513 min=0.01,
514 max=1000.0,
515 description="Noise x size"
517 noise_size_y: FloatProperty(
518 name="Size Y",
519 default=1.0,
520 min=0.01,
521 max=1000.0,
522 description="Noise y size"
524 noise_size_z: FloatProperty(
525 name="Size Z",
526 default=1.0,
527 min=0.01,
528 max=1000.0,
529 description="Noise Z size"
531 noise_size: FloatProperty(
532 name="Noise Size",
533 default=1.0,
534 min=0.01,
535 max=1000.0,
536 description="Noise size"
538 noise_type: EnumProperty(
539 name="Noise Type",
540 default='hetero_terrain',
541 description="Noise type",
542 items = [
543 ('multi_fractal', "Multi Fractal", "Blender: Multi Fractal algorithm", 0),
544 ('ridged_multi_fractal', "Ridged MFractal", "Blender: Ridged Multi Fractal", 1),
545 ('hybrid_multi_fractal', "Hybrid MFractal", "Blender: Hybrid Multi Fractal", 2),
546 ('hetero_terrain', "Hetero Terrain", "Blender: Hetero Terrain", 3),
547 ('fractal', "fBm Fractal", "Blender: fBm - Fractional Browninian motion", 4),
548 ('turbulence_vector', "Turbulence", "Blender: Turbulence Vector", 5),
549 ('variable_lacunarity', "Distorted Noise", "Blender: Distorted Noise", 6),
550 ('marble_noise', "Marble", "A.N.T.: Marble Noise", 7),
551 ('shattered_hterrain', "Shattered hTerrain", "A.N.T.: Shattered hTerrain", 8),
552 ('strata_hterrain', "Strata hTerrain", "A.N.T: Strata hTerrain", 9),
553 ('ant_turbulence', "Another Noise", "A.N.T: Turbulence variation", 10),
554 ('vl_noise_turbulence', "vlNoise turbulence", "A.N.T: Real vlNoise turbulence", 11),
555 ('vl_hTerrain', "vlNoise hTerrain", "A.N.T: vlNoise hTerrain", 12),
556 ('distorted_heteroTerrain', "Distorted hTerrain", "A.N.T distorted hTerrain", 13),
557 ('double_multiFractal', "Double MultiFractal", "A.N.T: double multiFractal", 14),
558 ('rocks_noise', "Noise Rocks", "A.N.T: turbulence variation", 15),
559 ('slick_rock', "Slick Rock", "A.N.T: slick rock", 16),
560 ('planet_noise', "Planet Noise", "Planet Noise by: Farsthary", 17),
561 ('blender_texture', "Blender Texture - Texture Nodes", "Blender texture data block", 18)]
563 basis_type: EnumProperty(
564 name="Noise Basis",
565 default=ant_noise.noise_basis_default,
566 description="Noise basis algorithms",
567 items = ant_noise.noise_basis
569 vl_basis_type: EnumProperty(
570 name="vlNoise Basis",
571 default=ant_noise.noise_basis_default,
572 description="VLNoise basis algorithms",
573 items = ant_noise.noise_basis
575 distortion: FloatProperty(
576 name="Distortion",
577 default=1.0,
578 min=0.01,
579 max=100.0,
580 description="Distortion amount"
582 hard_noise: EnumProperty(
583 name="Soft Hard",
584 default="0",
585 description="Soft Noise, Hard noise",
586 items = [
587 ("0", "Soft", "Soft Noise", 0),
588 ("1", "Hard", "Hard noise", 1)]
590 noise_depth: IntProperty(
591 name="Depth",
592 default=8,
593 min=0,
594 max=16,
595 description="Noise Depth - number of frequencies in the fBm"
597 amplitude: FloatProperty(
598 name="Amp",
599 default=0.5,
600 min=0.01,
601 max=1.0,
602 description="Amplitude"
604 frequency: FloatProperty(
605 name="Freq",
606 default=2.0,
607 min=0.01,
608 max=5.0,
609 description="Frequency"
611 dimension: FloatProperty(
612 name="Dimension",
613 default=1.0,
614 min=0.01,
615 max=2.0,
616 description="H - fractal dimension of the roughest areas"
618 lacunarity: FloatProperty(
619 name="Lacunarity",
620 min=0.01,
621 max=6.0,
622 default=2.0,
623 description="Lacunarity - gap between successive frequencies"
625 offset: FloatProperty(
626 name="Offset",
627 default=1.0,
628 min=0.01,
629 max=6.0,
630 description="Offset - raises the terrain from sea level"
632 gain: FloatProperty(
633 name="Gain",
634 default=1.0,
635 min=0.01,
636 max=6.0,
637 description="Gain - scale factor"
639 marble_bias: EnumProperty(
640 name="Bias",
641 default="0",
642 description="Marble bias",
643 items = [
644 ("0", "Sin", "Sin", 0),
645 ("1", "Cos", "Cos", 1),
646 ("2", "Tri", "Tri", 2),
647 ("3", "Saw", "Saw", 3)]
649 marble_sharp: EnumProperty(
650 name="Sharp",
651 default="0",
652 description="Marble sharpness",
653 items = [
654 ("0", "Soft", "Soft", 0),
655 ("1", "Sharp", "Sharp", 1),
656 ("2", "Sharper", "Sharper", 2),
657 ("3", "Soft inv.", "Soft", 3),
658 ("4", "Sharp inv.", "Sharp", 4),
659 ("5", "Sharper inv.", "Sharper", 5)]
661 marble_shape: EnumProperty(
662 name="Shape",
663 default="0",
664 description="Marble shape",
665 items= [
666 ("0", "Default", "Default", 0),
667 ("1", "Ring", "Ring", 1),
668 ("2", "Swirl", "Swirl", 2),
669 ("3", "Bump", "Bump", 3),
670 ("4", "Wave", "Wave", 4),
671 ("5", "Z", "Z", 5),
672 ("6", "Y", "Y", 6),
673 ("7", "X", "X", 7)]
675 height: FloatProperty(
676 name="Height",
677 default=0.5,
678 min=-10000.0,
679 max=10000.0,
680 description="Noise intensity scale"
682 height_invert: BoolProperty(
683 name="Invert",
684 default=False,
685 description="Height invert",
687 height_offset: FloatProperty(
688 name="Offset",
689 default=0.0,
690 min=-10000.0,
691 max=10000.0,
692 description="Height offset"
694 fx_mixfactor: FloatProperty(
695 name="Mix Factor",
696 default=0.0,
697 min=-1.0,
698 max=1.0,
699 description="Effect mix factor: -1.0 = Noise, +1.0 = Effect"
701 fx_mix_mode: EnumProperty(
702 name="Effect Mix",
703 default="0",
704 description="Effect mix mode",
705 items = [
706 ("0", "Mix", "Mix", 0),
707 ("1", "Add", "Add", 1),
708 ("2", "Sub", "Subtract", 2),
709 ("3", "Mul", "Multiply", 3),
710 ("4", "Abs", "Absolute", 4),
711 ("5", "Scr", "Screen", 5),
712 ("6", "Mod", "Modulo", 6),
713 ("7", "Min", "Minimum", 7),
714 ("8", "Max", "Maximum", 8)
717 fx_type: EnumProperty(
718 name="Effect Type",
719 default="0",
720 description="Effect type",
721 items = [
722 ("0", "None", "No effect", 0),
723 ("1", "Gradient", "Gradient", 1),
724 ("2", "Waves", "Waves - Bumps", 2),
725 ("3", "Zigzag", "Zigzag", 3),
726 ("4", "Wavy", "Wavy", 4),
727 ("5", "Bump", "Bump", 5),
728 ("6", "Dots", "Dots", 6),
729 ("7", "Rings", "Rings", 7),
730 ("8", "Spiral", "Spiral", 8),
731 ("9", "Square", "Square", 9),
732 ("10", "Blocks", "Blocks", 10),
733 ("11", "Grid", "Grid", 11),
734 ("12", "Tech", "Tech", 12),
735 ("13", "Crackle", "Crackle", 13),
736 ("14", "Cracks", "Cracks", 14),
737 ("15", "Rock", "Rock noise", 15),
738 ("16", "Lunar", "Craters", 16),
739 ("17", "Cosine", "Cosine", 17),
740 ("18", "Spikey", "Spikey", 18),
741 ("19", "Stone", "Stone", 19),
742 ("20", "Flat Turb", "Flat turbulence", 20),
743 ("21", "Flat Voronoi", "Flat voronoi", 21)
746 fx_bias: EnumProperty(
747 name="Effect Bias",
748 default="0",
749 description="Effect bias type",
750 items = [
751 ("0", "Sin", "Sin", 0),
752 ("1", "Cos", "Cos", 1),
753 ("2", "Tri", "Tri", 2),
754 ("3", "Saw", "Saw", 3),
755 ("4", "None", "None", 4)]
757 fx_turb: FloatProperty(
758 name="Distortion",
759 default=0.0,
760 min=0.0,
761 max=1000.0,
762 description="Effect turbulence distortion"
764 fx_depth: IntProperty(
765 name="Depth",
766 default=0,
767 min=0,
768 max=16,
769 description="Effect depth - number of frequencies"
771 fx_amplitude: FloatProperty(
772 name="Amp",
773 default=0.5,
774 min=0.01,
775 max=1.0,
776 description="Amplitude"
778 fx_frequency: FloatProperty(
779 name="Freq",
780 default=2.0,
781 min=0.01,
782 max=5.0,
783 description="Frequency"
785 fx_size: FloatProperty(
786 name="Effect Size",
787 default=1.0,
788 min=0.01,
789 max=1000.0,
790 description="Effect size"
792 fx_loc_x: FloatProperty(
793 name="Offset X",
794 default=0.0,
795 description="Effect x offset"
797 fx_loc_y: FloatProperty(
798 name="Offset Y",
799 default=0.0,
800 description="Effect y offset"
802 fx_height: FloatProperty(
803 name="Intensity",
804 default=1.0,
805 min=-1000.0,
806 max=1000.0,
807 description="Effect intensity scale"
809 fx_invert: BoolProperty(
810 name="Invert",
811 default=False,
812 description="Effect invert"
814 fx_offset: FloatProperty(
815 name="Offset",
816 default=0.0,
817 min=-1000.0,
818 max=1000.0,
819 description="Effect height offset"
822 edge_falloff: EnumProperty(
823 name="Falloff",
824 default="3",
825 description="Flatten edges",
826 items = [
827 ("0", "None", "None", 0),
828 ("1", "Y", "Y Falloff", 1),
829 ("2", "X", "X Falloff", 2),
830 ("3", "X Y", "X Y Falloff", 3)]
832 falloff_x: FloatProperty(
833 name="Falloff X",
834 default=4.0,
835 min=0.1,
836 max=100.0,
837 description="Falloff x scale"
839 falloff_y: FloatProperty(
840 name="Falloff Y",
841 default=4.0,
842 min=0.1,
843 max=100.0,
844 description="Falloff y scale"
846 edge_level: FloatProperty(
847 name="Edge Level",
848 default=0.0,
849 min=-10000.0,
850 max=10000.0,
851 description="Edge level, sealevel offset"
853 maximum: FloatProperty(
854 name="Maximum",
855 default=1.0,
856 min=-10000.0,
857 max=10000.0,
858 description="Maximum, flattens terrain at plateau level"
860 minimum: FloatProperty(
861 name="Minimum",
862 default=-1.0,
863 min=-10000.0,
864 max=10000.0,
865 description="Minimum, flattens terrain at seabed level"
867 vert_group: StringProperty(
868 name="Vertex Group",
869 default=""
871 strata: FloatProperty(
872 name="Amount",
873 default=5.0,
874 min=0.01,
875 max=1000.0,
876 description="Strata layers / terraces"
878 strata_type: EnumProperty(
879 name="Strata",
880 default="0",
881 description="Strata types",
882 items = [
883 ("0", "None", "No strata", 0),
884 ("1", "Smooth", "Smooth transitions", 1),
885 ("2", "Sharp Sub", "Sharp subtract transitions", 2),
886 ("3", "Sharp Add", "Sharp add transitions", 3),
887 ("4", "Quantize", "Quantize", 4),
888 ("5", "Quantize Mix", "Quantize mixed", 5)]
890 water_plane: BoolProperty(
891 name="Water Plane",
892 default=False,
893 description="Add water plane"
895 water_level: FloatProperty(
896 name="Level",
897 default=0.01,
898 min=-10000.0,
899 max=10000.0,
900 description="Water level"
902 remove_double: BoolProperty(
903 name="Remove Doubles",
904 default=False,
905 description="Remove doubles"
907 refresh: BoolProperty(
908 name="Refresh",
909 default=False,
910 description="Refresh"
912 auto_refresh: BoolProperty(
913 name="Auto",
914 default=True,
915 description="Automatic refresh"
918 # ------------------------------------------------------------
919 # Register:
921 classes = (
922 AntLandscapeAddPanel,
923 AntLandscapeToolsPanel,
924 AntMainSettingsPanel,
925 AntNoiseSettingsPanel,
926 AntDisplaceSettingsPanel,
927 AntLandscapePropertiesGroup,
928 add_mesh_ant_landscape.AntAddLandscape,
929 mesh_ant_displace.AntMeshDisplace,
930 ant_functions.AntLandscapeRefresh,
931 ant_functions.AntLandscapeRegenerate,
932 ant_functions.AntVgSlopeMap,
933 ant_functions.Eroder,
936 def register():
937 for cls in classes:
938 bpy.utils.register_class(cls)
940 bpy.types.VIEW3D_MT_mesh_add.append(menu_func_landscape)
941 bpy.types.Object.ant_landscape = PointerProperty(type=AntLandscapePropertiesGroup, name="ANT_Landscape", description="Landscape properties")
942 bpy.types.VIEW3D_MT_paint_weight.append(menu_func_eroder)
945 def unregister():
946 for cls in reversed(classes):
947 bpy.utils.unregister_class(cls)
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()