Skip to content

Commit

Permalink
Import packages using absolute path, panel visibility tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
petak5 committed Apr 25, 2022
1 parent cb351f6 commit 4d02d9b
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 27 deletions.
12 changes: 6 additions & 6 deletions terrain_eroder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import bpy
from bpy.props import PointerProperty

from .panels.my_plugin_panel import CreatorPanel, AnimateObjectOperator
from .panels.erosion_panel import ErosionPanel
from .operators.create_terrain_operator import CreateTerrainOperator
from .operators.erosion_operator import ErosionOperator
from .properties.terrain_properties import TerrainProperties
from .properties.erosion_properties import ErosionProperties
from terrain_eroder.panels.creator_panel import CreatorPanel, AnimateObjectOperator
from terrain_eroder.panels.erosion_panel import ErosionPanel
from terrain_eroder.operators.create_terrain_operator import CreateTerrainOperator
from terrain_eroder.operators.erosion_operator import ErosionOperator
from terrain_eroder.properties.terrain_properties import TerrainProperties
from terrain_eroder.properties.erosion_properties import ErosionProperties


bl_info = {
Expand Down
4 changes: 2 additions & 2 deletions terrain_eroder/erosions/hydraulic_erosion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from bmesh.types import BMesh, BMVert
import numpy as np

from .tools import edge_get_neighbour_vertex
from ..model.types import ErosionStatus
from terrain_eroder.erosions.tools import edge_get_neighbour_vertex
from terrain_eroder.model.types import ErosionStatus


class HydraulicErosionSettings:
Expand Down
2 changes: 1 addition & 1 deletion terrain_eroder/erosions/hydraulic_erosion_pb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime
import random

from ..model.types import Mesh, INDEX_ID, INDEX_X, INDEX_Y, INDEX_Z, ErosionStatus
from terrain_eroder.model.types import Mesh, INDEX_ID, INDEX_X, INDEX_Y, INDEX_Z, ErosionStatus


class HydraulicErosionPBSettings:
Expand Down
6 changes: 3 additions & 3 deletions terrain_eroder/erosions/thermal_erosion.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import concurrent.futures
from multiprocessing import Pool, cpu_count

from .tools import edge_get_neighbour_vertex, bmesh_to_mesh, mesh_to_bmesh
from .thermal_erosion_method import calculate_erosion
from ..model.types import Mesh, INDEX_ID, INDEX_X, INDEX_Y, INDEX_Z, ErosionStatus
from terrain_eroder.erosions.tools import edge_get_neighbour_vertex, bmesh_to_mesh, mesh_to_bmesh
from terrain_eroder.erosions.thermal_erosion_method import calculate_erosion
from terrain_eroder.model.types import Mesh, INDEX_ID, INDEX_X, INDEX_Y, INDEX_Z, ErosionStatus


class ThermalErosionSettings:
Expand Down
2 changes: 1 addition & 1 deletion terrain_eroder/erosions/thermal_erosion_method.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from math import sqrt

from ..model.types import Mesh, INDEX_ID, INDEX_X, INDEX_Y, INDEX_Z
from terrain_eroder.model.types import Mesh, INDEX_ID, INDEX_X, INDEX_Y, INDEX_Z


def calculate_erosion(mesh: Mesh, T: float, C: float) -> dict[int, float]:
Expand Down
4 changes: 2 additions & 2 deletions terrain_eroder/erosions/tools.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np

from bmesh.types import BMesh, BMVert, BMEdge
from ..model.types import Mesh, INDEX_X, INDEX_Y, INDEX_Z

from terrain_eroder.model.types import Mesh, INDEX_X, INDEX_Y, INDEX_Z


# Returns neighbour vertex from edge at index i
Expand Down
Empty file.
12 changes: 6 additions & 6 deletions terrain_eroder/operators/erosion_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from datetime import datetime
from threading import Thread

from ..erosions.thermal_erosion import thermal_erosion_old, ThermalErosionSettings
from ..erosions.hydraulic_erosion import hydraulic_erosion, HydraulicErosionSettings
from ..erosions.hydraulic_erosion_pb import hydraulic_erosion_pb, HydraulicErosionPBSettings
from ..properties.erosion_properties import ErosionProperties
from ..erosions.tools import bmesh_to_mesh, mesh_to_bmesh
from ..model.types import Mesh, ErosionStatus
from terrain_eroder.erosions.thermal_erosion import thermal_erosion_old, ThermalErosionSettings
from terrain_eroder.erosions.hydraulic_erosion import hydraulic_erosion, HydraulicErosionSettings
from terrain_eroder.erosions.hydraulic_erosion_pb import hydraulic_erosion_pb, HydraulicErosionPBSettings
from terrain_eroder.properties.erosion_properties import ErosionProperties
from terrain_eroder.erosions.tools import bmesh_to_mesh, mesh_to_bmesh
from terrain_eroder.model.types import Mesh, ErosionStatus


class ErosionOperator(bpy.types.Operator):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import bpy

from ..properties.terrain_properties import TerrainProperties
from terrain_eroder.properties.terrain_properties import TerrainProperties


class AnimateObjectOperator(bpy.types.Operator):
Expand Down Expand Up @@ -28,9 +28,11 @@ def animate_object(self, context):
class CreatorPanel(bpy.types.Panel):
bl_label = "Terrain Creator"
bl_idname = "OBJECT_PT_terrain_creator"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_context = "objectmode"
bl_category = "Eroder"
bl_options = { "DEFAULT_CLOSED" }

def draw(self, context):
properties: TerrainProperties = context.scene.terrain_properties
Expand Down
7 changes: 4 additions & 3 deletions terrain_eroder/panels/erosion_panel.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import bpy

from ..properties.erosion_properties import ErosionProperties
from terrain_eroder.properties.erosion_properties import ErosionProperties


class ErosionPanel(bpy.types.Panel):
bl_label = "Terrain Erosion"
bl_idname = "OBJECT_PT_terrain_erosion"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_context = "objectmode"
bl_category = "Eroder"

def draw(self, context: bpy.types.Context):
Expand Down

0 comments on commit 4d02d9b

Please sign in to comment.