[Bf-extensions-cvs] [022c438f] master: ant landscape: update/various fixes

Jimmy Hazevoet noreply at git.blender.org
Sun Jul 2 10:17:36 CEST 2017


Commit: 022c438f26ee9f6f3173b28794c6a271246f92e0
Author: Jimmy Hazevoet
Date:   Sun Jul 2 18:17:00 2017 +1000
Branches: master
https://developer.blender.org/rBA022c438f26ee9f6f3173b28794c6a271246f92e0

ant landscape: update/various fixes

===================================================================

M	ant_landscape/ErosionR.txt
M	ant_landscape/__init__.py
M	ant_landscape/add_mesh_ant_landscape.py
M	ant_landscape/ant_functions.py
M	ant_landscape/ant_landscape_refresh.py
M	ant_landscape/eroder.py
M	ant_landscape/mesh_ant_displace.py
M	ant_landscape/stats.py
M	ant_landscape/test.py
M	ant_landscape/utils.py
A	presets/operator/mesh.eroder/default.py
A	presets/operator/mesh.eroder/light_erosion.py
A	presets/operator/mesh.eroder/medium_erosion.py
A	presets/operator/mesh.eroder/strong_erosion.py
A	presets/operator/mesh.eroder/thermal_diffusion.py
M	presets/operator/mesh.landscape_add/abstract.py
A	presets/operator/mesh.landscape_add/another_noise.py
M	presets/operator/mesh.landscape_add/billow.py
M	presets/operator/mesh.landscape_add/canion.py
M	presets/operator/mesh.landscape_add/canions.py
A	presets/operator/mesh.landscape_add/cliff.py
A	presets/operator/mesh.landscape_add/cosine.py
A	presets/operator/mesh.landscape_add/dune.py
M	presets/operator/mesh.landscape_add/flatstone.py
A	presets/operator/mesh.landscape_add/gully.py
A	presets/operator/mesh.landscape_add/lakes_1.py
A	presets/operator/mesh.landscape_add/lakes_2.py
R076	presets/operator/mesh.landscape_add/terrain_large.py	presets/operator/mesh.landscape_add/large_terrain.py
R095	presets/operator/mesh.landscape_add/plateau.py	presets/operator/mesh.landscape_add/mesa.py
M	presets/operator/mesh.landscape_add/mounds.py
R098	presets/operator/mesh.landscape_add/mountain.py	presets/operator/mesh.landscape_add/mountain_1.py
A	presets/operator/mesh.landscape_add/mountain_2.py
A	presets/operator/mesh.landscape_add/planet.py
M	presets/operator/mesh.landscape_add/planet_noise.py
M	presets/operator/mesh.landscape_add/ridged.py
A	presets/operator/mesh.landscape_add/river.py
A	presets/operator/mesh.landscape_add/rock.py
M	presets/operator/mesh.landscape_add/slick_rock.py
R092	presets/operator/mesh.landscape_add/techno_grid.py	presets/operator/mesh.landscape_add/techno_cell.py
M	presets/operator/mesh.landscape_add/voronoi_hills.py
M	presets/operator/mesh.landscape_add/vulcano.py
A	presets/operator/mesh.landscape_add/yin_yang.py

===================================================================

diff --git a/ant_landscape/ErosionR.txt b/ant_landscape/ErosionR.txt
index 1c461945..1dae7aa0 100644
--- a/ant_landscape/ErosionR.txt
+++ b/ant_landscape/ErosionR.txt
@@ -1,3 +1,2 @@
 http://blog.michelanders.nl/search/label/erosion
-https://github.com/nerk987/ErosionR
-https://blenderartists.org/forum/showthread.php?323808-Simulating-erosion-in-Blender
\ No newline at end of file
+https://github.com/nerk987/ErosionR
\ No newline at end of file
diff --git a/ant_landscape/__init__.py b/ant_landscape/__init__.py
index d0f1528d..de916966 100644
--- a/ant_landscape/__init__.py
+++ b/ant_landscape/__init__.py
@@ -17,7 +17,7 @@
 # ##### END GPL LICENSE BLOCK #####
 
 # Another Noise Tool - Suite (W.I.P.)
-# Jim Hazevoet 5/2017
+# Jimmy Hazevoet 5/2017
 
 bl_info = {
     "name": "A.N.T.Landscape",
@@ -67,7 +67,9 @@ from .ant_functions import (
 # Menu's and panels
 
 def menu_func_eroder(self, context):
-    self.layout.operator('mesh.eroder', text="Landscape Eroder", icon='SMOOTHCURVE')
+    ob = bpy.context.active_object
+    if ob and (ob.ant_landscape.keys() and not ob.ant_landscape['sphere_mesh']):
+        self.layout.operator('mesh.eroder', text="Landscape Eroder", icon='SMOOTHCURVE')
 
 
 def menu_func_landscape(self, context):
@@ -107,8 +109,9 @@ class AntLandscapeToolsPanel(bpy.types.Panel):
         ob = context.active_object
         col = layout.column()
         col.operator('mesh.ant_displace', text="Mesh Displace", icon="RNDCURVE")
-        col.operator('mesh.eroder', text="Landscape Eroder", icon='SMOOTHCURVE')
         col.operator('mesh.ant_slope_map', icon='GROUP_VERTEX')
+        if ob.ant_landscape.keys() and not ob.ant_landscape['sphere_mesh']:
+            col.operator('mesh.eroder', text="Landscape Eroder", icon='SMOOTHCURVE')
 
 
 # Landscape Settings / Properties:
@@ -299,6 +302,12 @@ class AntNoiseSettingsPanel(bpy.types.Panel):
             col.prop(ant, "gain")
             col.separator()
             col.prop(ant, "vl_basis_type")
+        elif ant.noise_type == "rocks_noise":
+            col.prop(ant, "noise_depth")
+            col.prop(ant, "distortion")
+            col.separator()
+            row = col.row(align=True)
+            row.prop(ant, "hard_noise", expand=True)
         elif ant.noise_type == "slick_rock":
             col.prop(ant, "noise_depth")
             col.prop(ant, "dimension")
@@ -514,9 +523,10 @@ class AntLandscapePropertiesGroup(bpy.types.PropertyGroup):
                 ('vl_hTerrain', "vlNoise hTerrain", "A.N.T: vlNoise hTerrain", 12),
                 ('distorted_heteroTerrain', "Distorted hTerrain", "A.N.T distorted hTerrain", 13),
                 ('double_multiFractal', "Double MultiFractal", "A.N.T: double multiFractal", 14),
-                ('slick_rock', "Slick Rock", "A.N.T: slick rock", 15),
-                ('planet_noise', "Planet Noise", "Planet Noise by: Farsthary", 16),
-                ('blender_texture', "Blender Texture - Texture Nodes", "Blender texture data block", 17)]
+                ('rocks_noise', "Noise Rocks", "A.N.T: turbulence variation", 15),
+                ('slick_rock', "Slick Rock", "A.N.T: slick rock", 16),
+                ('planet_noise', "Planet Noise", "Planet Noise by: Farsthary", 17),
+                ('blender_texture', "Blender Texture - Texture Nodes", "Blender texture data block", 18)]
             )
     basis_type = EnumProperty(
             name="Noise Basis",
@@ -735,8 +745,8 @@ class AntLandscapePropertiesGroup(bpy.types.PropertyGroup):
                 ("1", "Smooth", "Smooth transitions", 1),
                 ("2", "Sharp Sub", "Sharp substract transitions", 2),
                 ("3", "Sharp Add", "Sharp add transitions", 3),
-                ("4", "Posterize", "Posterize", 4),
-                ("5", "Posterize Mix", "Posterize mixed", 5)]
+                ("4", "Quantize", "Quantize", 4),
+                ("5", "Quantize Mix", "Quantize mixed", 5)]
             )
     water_plane = BoolProperty(
             name="Water Plane",
diff --git a/ant_landscape/add_mesh_ant_landscape.py b/ant_landscape/add_mesh_ant_landscape.py
index c7de90f3..7fc4a268 100644
--- a/ant_landscape/add_mesh_ant_landscape.py
+++ b/ant_landscape/add_mesh_ant_landscape.py
@@ -17,7 +17,7 @@
 # ##### END GPL LICENSE BLOCK #####
 
 # Another Noise Tool - Landscape
-# Jim Hazevoet
+# Jimmy Hazevoet
 
 # import modules
 import bpy
@@ -47,7 +47,7 @@ from .ant_functions import (
 class AntAddLandscape(bpy.types.Operator):
     bl_idname = "mesh.landscape_add"
     bl_label = "Another Noise Tool - Landscape"
-    bl_description = "A.N.T. Add landscape mesh"
+    bl_description = "Add landscape mesh"
     bl_options = {'REGISTER', 'UNDO', 'PRESET'}
 
     ant_terrain_name = StringProperty(
@@ -191,9 +191,10 @@ class AntAddLandscape(bpy.types.Operator):
                 ('vl_hTerrain', "vlNoise hTerrain", "A.N.T: vlNoise hTerrain", 12),
                 ('distorted_heteroTerrain', "Distorted hTerrain", "A.N.T distorted hTerrain", 13),
                 ('double_multiFractal', "Double MultiFractal", "A.N.T: double multiFractal", 14),
-                ('slick_rock', "Slick Rock", "A.N.T: slick rock", 15),
-                ('planet_noise', "Planet Noise", "Planet Noise by: Farsthary", 16),
-                ('blender_texture', "Blender Texture - Texture Nodes", "Blender texture data block", 17)]
+                ('rocks_noise', "Noise Rocks", "A.N.T: turbulence variation", 15),
+                ('slick_rock', "Slick Rock", "A.N.T: slick rock", 16),
+                ('planet_noise', "Planet Noise", "Planet Noise by: Farsthary", 17),
+                ('blender_texture', "Blender Texture - Texture Nodes", "Blender texture data block", 18)]
             )
     basis_type = EnumProperty(
             name="Noise Basis",
@@ -412,8 +413,8 @@ class AntAddLandscape(bpy.types.Operator):
                 ("1", "Smooth", "Smooth transitions", 1),
                 ("2", "Sharp Sub", "Sharp substract transitions", 2),
                 ("3", "Sharp Add", "Sharp add transitions", 3),
-                ("4", "Posterize", "Posterize", 4),
-                ("5", "Posterize Mix", "Posterize mixed", 5)]
+                ("4", "Quantize", "Quantize", 4),
+                ("5", "Quantize Mix", "Quantize mixed", 5)]
             )
     water_plane = BoolProperty(
             name="Water Plane",
diff --git a/ant_landscape/ant_functions.py b/ant_landscape/ant_functions.py
index 5ccbeade..ce7751af 100644
--- a/ant_landscape/ant_functions.py
+++ b/ant_landscape/ant_functions.py
@@ -17,7 +17,7 @@
 # ##### END GPL LICENSE BLOCK #####
 
 # Another Noise Tool - Functions
-# Jim Hazevoet
+# Jimmy Hazevoet
 
 # ErosionR:
 # Michel Anders (varkenvarken), Ian Huish (nerk)
@@ -60,17 +60,11 @@ from bpy_extras import object_utils
 def create_mesh_object(context, verts, edges, faces, name):
     # Create new mesh
     mesh = bpy.data.meshes.new(name)
-
     # Make a mesh from a list of verts/edges/faces.
     mesh.from_pydata(verts, [], faces)
-
     # Update mesh geometry after adding stuff.
     mesh.update()
-
-    #new_ob = bpy.data.objects.new(name, mesh)
-    #context.scene.objects.link(new_ob)
     return object_utils.object_data_add(context, mesh, operator=None)
-    #return new_ob
 
 
 # Generate XY Grid
@@ -172,12 +166,7 @@ class AntVgSlopeMap(bpy.types.Operator):
             default=0.0,
             min=0.0,
             max=1.0,
-            description="Increase to select more vertices"
-            )
-    weight_mode = BoolProperty(
-            name="Enter WeightPaint Mode:",
-            default=True,
-            description="Enter weightpaint mode when done"
+            description="Increase to select more vertices on slopes"
             )
 
     @classmethod
@@ -192,8 +181,8 @@ class AntVgSlopeMap(bpy.types.Operator):
 
 
     def execute(self, context):
-        message = "Popup Values: %d, %f, %s, %s, %s" % \
-            (self.select_flat, self.select_range, self.group_name, self.z_method, self.weight_mode)
+        message = "Popup Values: %d, %f, %s, %s" % \
+            (self.select_flat, self.select_range, self.group_name, self.z_method)
         self.report({'INFO'}, message)
 
         bpy.ops.object.mode_set(mode='OBJECT')
@@ -223,8 +212,7 @@ class AntVgSlopeMap(bpy.types.Operator):
 
         vg_normal.name = self.group_name
 
-        if self.weight_mode:
-            bpy.ops.paint.weight_paint_toggle()
+        bpy.ops.paint.weight_paint_toggle()
         return {'FINISHED'}
 
 
@@ -395,9 +383,19 @@ def vl_hTerrain(coords, H, lacunarity, octaves, offset, basis, vlbasis, distort)
 # another turbulence
 def ant_turbulence(coords, depth, hardnoise, nbasis, amp, freq, distortion):
     x, y, z = coords
-    tv = turbulence_vector((x + 1, y + 2, z + 3), depth, hardnoise, nbasis, amp, freq)
-    d = (distortion * tv[0]) * 0.25
-    return (d + ((tv[0] - tv[1]) * (tv[2])**2))
+    t = turbulence_vector((x/2, y/2, z/2), depth, 0, nbasis, amp, freq) * 0.5 * distortion
+    return turbulence((t[0], t[1], t[2]), 2, hardnoise, 3) * 0.5 + 0.5
+
+
+# rocks noise
+def rocks_noise(coords, depth, hardnoise, nbasis, distortion):
+    x,y,z = coords
+    p = turbulence((x, y, z), 4, 0, 0) * 0.125 * distortion
+    xx, yy, zz = x, y, z
+    a = turbulence((xx + p, yy + p, zz), 2, 0, 7)
+    pa = a * 0.1875 * distortion
+    b = turbulence((x, y, z + pa), depth, hardnoise, nbasis)
+    return ((a + 0.5 * (b - a)) * 0.5 + 0.5)
 
 
 # shattered_hterrain:
@@ -570,13 +568,16 @@ def noise_gen(coords, props):
     elif ntype in [14, 'double_multiFractal']:
         value = double_multiFractal(ncoords, dimension, lacunarity, depth, offset, gain, nbasis, vlbasis)
 
-    elif ntype in [15, 'slick_rock']:
+    elif ntype in [15, 'rocks_noise']:
+        value = rocks_noise(ncoords, depth, hardnoise, nbasis, distortion)
+
+    elif ntype in [16, 'slick_rock']:
         value = slick_rock(ncoords,dimension, lacunarity, depth, offset, gain, distortion, nbasis, vlbasis)
 
-    elif ntype in [16, 'planet_noise']:
+    elif ntype in [17, 'planet_noise']:
         value = planet_noise(ncoords, depth, hardnoise, nbasis)[2] * 0.5 + 0.5
 
-    elif ntype in [17, 'blender_texture']:
+    elif ntype in [18, 'blender_texture'

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list