Skip to content

Commit

Permalink
Register all panels and tidy up config
Browse files Browse the repository at this point in the history
  • Loading branch information
ruaridhg committed Oct 18, 2023
1 parent 46e4bab commit e37fa0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion randomisation_seed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ source ~/.bash_profile

# zip randomiser, launch blender and install+enable
zip randomiser.zip -FS -r randomiser/
blender random_all.blend --python install_and_enable_addons.py -- ./randomiser.zip --seed 32 --input ./input_parameters.json --output ./transform_geom_mat_test.json
blender random_all.blend --python install_and_enable_addons.py -- ./randomiser.zip --seed 32 --input ./input_bounds.json --output ./output_randomisations_per_frame1697116725.310647.json
2 changes: 1 addition & 1 deletion randomiser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from . import material, transform, geometry, seed, define_prop # random_all
from . import material, transform, geometry, seed, define_prop, random_all

bl_info = {
"name": "Randomisations panel",
Expand Down
21 changes: 5 additions & 16 deletions randomiser/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# will be defined as classes, but only those panels with
# index < total number of group nodes per material
# will be displayed.
MAX_NUMBER_OF_SUBSUBPANELS = 10
MAX_NUMBER_OF_SUBSUBPANELS = 100


# Keyword to search for in nodes' names, to identify nodes to randomise
Expand Down Expand Up @@ -48,36 +48,25 @@
bpy.types.NodeSocketVector: {"min": -np.inf, "max": np.inf},
bpy.types.NodeSocketColor: {"min": 0.0, "max": 1.0},
bpy.types.NodeSocketInt: {
"min": int(-1000), # -2147483648
"max": int(1000), # 2147483647
}, # ---- not sure this will work?
"min": int(-2147483648),
"max": int(2147483647),
},
bpy.types.NodeSocketBool: {"min": False, "max": True},
}


MAP_PROPS_TO_ATTR = {
# bpy.types.NodeSocketFloat: "float_1d"
# bpy.props.FloatVectorProperty size=1,
Vector: "float_3d", # bpy.props.FloatVectorProperty size=3,
Vector: "float_3d",
float: "float_1d",
int: "int_1d",
bool: "bool_1d",
Euler: "euler",
# bpy.types.NodeSocketInt: "int_1d"
# bpy.props.IntProperty,
# bpy.types.NodeSocketColor: "rgba_4d", # "float_4d", if
# bpy.types.NodeSocketBool: "bool_1d", elif
}

MAP_PROPS_TO_INI_MIN_MAX = {
# bpy.types.NodeSocketFloat: {"min": -np.inf, "max": np.inf},
Vector: {"min": -np.inf, "max": np.inf},
float: {"min": -np.inf, "max": np.inf},
int: {"min": int(-2147483648), "max": int(2147483647)},
bool: {"min": False, "max": True},
Euler: {"min": -np.inf, "max": np.inf},
# bpy.types.NodeSocketInt: {
# "min": int(-1000), # -2147483648
# "max": int(1000), # 2147483647
# }, # ---- not sure this will work?
}

0 comments on commit e37fa0d

Please sign in to comment.