Skip to content

Commit

Permalink
ant landscape: fix noise types
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy Hazevoet authored and meta-androcto committed Jul 11, 2017
1 parent dbb3c56 commit 5de4329
Show file tree
Hide file tree
Showing 38 changed files with 1,931 additions and 761 deletions.
180 changes: 168 additions & 12 deletions ant_landscape/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
if "bpy" in locals():
import importlib
importlib.reload(add_mesh_ant_landscape)
importlib.reload(ant_landscape_refresh)
importlib.reload(mesh_ant_displace)
importlib.reload(ant_functions)
importlib.reload(ant_noise)
else:
from ant_landscape import add_mesh_ant_landscape
from ant_landscape import ant_landscape_refresh
from ant_landscape import mesh_ant_displace
from ant_landscape import ant_functions
from ant_landscape import ant_noise

import bpy

Expand All @@ -54,15 +54,13 @@
PointerProperty,
EnumProperty,
)

from .ant_functions import (
draw_ant_refresh,
draw_ant_main,
draw_ant_noise,
draw_ant_displace,
)


# ------------------------------------------------------------
# Menu's and panels

Expand Down Expand Up @@ -114,7 +112,7 @@ def draw(self, context):
col.operator('mesh.eroder', text="Landscape Eroder", icon='SMOOTHCURVE')


# Landscape Settings / Properties:
# Landscape Main Settings
class AntMainSettingsPanel(bpy.types.Panel):
bl_idname = "ANTMAIN_PT_layout"
bl_options = {'DEFAULT_CLOSED'}
Expand Down Expand Up @@ -156,7 +154,7 @@ def draw(self, context):
col.prop(ant, "mesh_size_y")


# Landscape Settings / Properties:
# Landscape Noise Settings
class AntNoiseSettingsPanel(bpy.types.Panel):
bl_idname = "ANTNOISE_PT_layout"
bl_options = {'DEFAULT_CLOSED'}
Expand Down Expand Up @@ -194,7 +192,8 @@ def draw(self, context):
col = box.column(align=True)
col.prop(ant, "noise_offset_x")
col.prop(ant, "noise_offset_y")
col.prop(ant, "noise_offset_z")
if ant.sphere_mesh:
col.prop(ant, "noise_offset_z")
col.prop(ant, "noise_size_x")
col.prop(ant, "noise_size_y")
if ant.sphere_mesh:
Expand Down Expand Up @@ -274,7 +273,7 @@ def draw(self, context):
col.prop(ant, "frequency")
col.prop(ant, "distortion")
col.separator()
col.prop(ant, "vl_basis_type")
box.prop(ant, "vl_basis_type")
col.separator()
row = col.row(align=True)
row.prop(ant, "hard_noise", expand=True)
Expand All @@ -285,7 +284,7 @@ def draw(self, context):
col.prop(ant, "offset")
col.prop(ant, "distortion")
col.separator()
col.prop(ant, "vl_basis_type")
box.prop(ant, "vl_basis_type")
elif ant.noise_type == "distorted_heteroTerrain":
col.prop(ant, "noise_depth")
col.prop(ant, "dimension")
Expand All @@ -301,7 +300,7 @@ def draw(self, context):
col.prop(ant, "offset")
col.prop(ant, "gain")
col.separator()
col.prop(ant, "vl_basis_type")
box.prop(ant, "vl_basis_type")
elif ant.noise_type == "rocks_noise":
col.prop(ant, "noise_depth")
col.prop(ant, "distortion")
Expand All @@ -316,15 +315,44 @@ def draw(self, context):
col.prop(ant, "offset")
col.prop(ant, "distortion")
col.separator()
col.prop(ant, "vl_basis_type")
box.prop(ant, "vl_basis_type")
elif ant.noise_type == "planet_noise":
col.prop(ant, "noise_depth")
col.separator()
row = col.row(align=True)
row.prop(ant, "hard_noise", expand=True)

# Effects mix
col = box.column(align=False)
box.prop(ant, "fx_type")
if ant.fx_type != "0":
if int(ant.fx_type) <= 12:
box.prop(ant, "fx_bias")

box.prop(ant, "fx_mix_mode")
col = box.column(align=True)
col.prop(ant, "fx_mixfactor")

col = box.column(align=True)
col.prop(ant, "fx_loc_x")
col.prop(ant, "fx_loc_y")
col.prop(ant, "fx_size")

col = box.column(align=True)
col.prop(ant, "fx_depth")
if ant.fx_depth != 0:
col.prop(ant, "fx_frequency")
col.prop(ant, "fx_amplitude")
col.prop(ant, "fx_turb")

col = box.column(align=True)
row = col.row(align=True).split(0.92, align=True)
row.prop(ant, "fx_height")
row.prop(ant, "fx_invert", toggle=True, text="", icon='ARROW_LEFTRIGHT')
col.prop(ant, "fx_offset")


# Landscape Settings / Properties:
# Landscape Displace Settings
class AntDisplaceSettingsPanel(bpy.types.Panel):
bl_idname = "ANTDISP_PT_layout"
bl_options = {'DEFAULT_CLOSED'}
Expand Down Expand Up @@ -679,6 +707,134 @@ class AntLandscapePropertiesGroup(bpy.types.PropertyGroup):
max=10000.0,
description="Height offset"
)
fx_mixfactor = FloatProperty(
name="Mix Factor",
default=0.0,
min=-1.0,
max=1.0,
description="Effect mix factor: -1.0 = Noise, +1.0 = Effect"
)
fx_mix_mode = EnumProperty(
name="Effect Mix",
default="0",
description="Effect mix mode",
items = [
("0", "Mix", "Mix", 0),
("1", "Add", "Add", 1),
("2", "Sub", "Subtract", 2),
("3", "Mul", "Multiply", 3),
("4", "Abs", "Absolute", 4),
("5", "Scr", "Screen", 5),
("6", "Mod", "Modulo", 6),
("7", "Min", "Minimum", 7),
("8", "Max", "Maximum", 8)
]
)
fx_type = EnumProperty(
name="Effect Type",
default="0",
description="Effect type",
items = [
("0", "None", "No effect", 0),
("1", "Gradient", "Gradient", 1),
("2", "Waves", "Waves - Bumps", 2),
("3", "Zigzag", "Zigzag", 3),
("4", "Wavy", "Wavy", 4),
("5", "Bump", "Bump", 5),
("6", "Dots", "Dots", 6),
("7", "Rings", "Rings", 7),
("8", "Spiral", "Spiral", 8),
("9", "Square", "Square", 9),
("10", "Blocks", "Blocks", 10),
("11", "Grid", "Grid", 11),
("12", "Tech", "Tech", 12),
("13", "Crackle", "Crackle", 13),
("14", "Cracks", "Cracks", 14),
("15", "Rock", "Rock noise", 15),
("16", "Lunar", "Craters", 16),
("17", "Cosine", "Cosine", 17),
("18", "Spikey", "Spikey", 18),
("19", "Stone", "Stone", 19),
("20", "Flat Turb", "Flat turbulence", 20),
("21", "Flat Voronoi", "Flat voronoi", 21)
]
)
fx_bias = EnumProperty(
name="Effect Bias",
default="0",
description="Effect bias type",
items = [
("0", "Sin", "Sin", 0),
("1", "Cos", "Cos", 1),
("2", "Tri", "Tri", 2),
("3", "Saw", "Saw", 3),
("4", "None", "None", 4)]
)
fx_turb = FloatProperty(
name="Distortion",
default=0.0,
min=0.0,
max=1000.0,
description="Effect turbulence distortion"
)
fx_depth = IntProperty(
name="Depth",
default=0,
min=0,
max=16,
description="Effect depth - number of frequencies"
)
fx_amplitude = FloatProperty(
name="Amp",
default=0.5,
min=0.01,
max=1.0,
description="Amplitude"
)
fx_frequency = FloatProperty(
name="Freq",
default=2.0,
min=0.01,
max=5.0,
description="Frequency"
)
fx_size = FloatProperty(
name="Effect Size",
default=1.0,
min=0.01,
max=1000.0,
description="Effect size"
)
fx_loc_x = FloatProperty(
name="Offset X",
default=0.0,
description="Effect x offset"
)
fx_loc_y = FloatProperty(
name="Offset Y",
default=0.0,
description="Effect y offset"
)
fx_height = FloatProperty(
name="Intensity",
default=1.0,
min=-1000.0,
max=1000.0,
description="Effect intensity scale"
)
fx_invert = BoolProperty(
name="Invert",
default=False,
description="Effect invert"
)
fx_offset = FloatProperty(
name="Offset",
default=0.0,
min=-1000.0,
max=1000.0,
description="Effect height offset"
)

edge_falloff = EnumProperty(
name="Falloff",
default="3",
Expand Down
Loading

0 comments on commit 5de4329

Please sign in to comment.