Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plugin issues in latest blender versions #289

Open
wants to merge 2 commits into
base: blender_28
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,31 @@

class Preferences(bpy.types.AddonPreferences):
bl_idname = __package__
auto_check_update = bpy.props.BoolProperty(
auto_check_update: bpy.props.BoolProperty(
name="Auto-check for Update",
description="If enabled, auto-check for updates using an interval",
default=True,
)
updater_intrval_months = bpy.props.IntProperty(
updater_intrval_months: bpy.props.IntProperty(
name='Months',
description="Number of months between checking for updates",
default=0,
min=0
)
updater_intrval_days = bpy.props.IntProperty(
updater_intrval_days: bpy.props.IntProperty(
name='Days',
description="Number of days between checking for updates",
default=7,
min=0,
)
updater_intrval_hours = bpy.props.IntProperty(
updater_intrval_hours: bpy.props.IntProperty(
name='Hours',
description="Number of hours between checking for updates",
default=0,
min=0,
max=23
)
updater_intrval_minutes = bpy.props.IntProperty(
updater_intrval_minutes: bpy.props.IntProperty(
name='Minutes',
description="Number of minutes between checking for updates",
default=0,
Expand Down Expand Up @@ -121,4 +121,4 @@ def unregister():
unregister_class(cls)

# if __name__ == "__main__":
# register()
# register()
14 changes: 7 additions & 7 deletions addon_updater_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ class addon_updater_install_popup(bpy.types.Operator):
# if true, run clean install - ie remove all files before adding new
# equivalent to deleting the addon and reinstalling, except the
# updater folder/backup folder remains
clean_install = bpy.props.BoolProperty(
clean_install: bpy.props.BoolProperty(
name="Clean install",
description="If enabled, completely clear the addon's folder before installing new update, creating a fresh install",
default=False,
options={'HIDDEN'}
)
ignore_enum = bpy.props.EnumProperty(
ignore_enum: bpy.props.EnumProperty(
name="Process update",
description="Decide to install, ignore, or defer new addon update",
items=[
Expand Down Expand Up @@ -256,7 +256,7 @@ class addon_updater_update_now(bpy.types.Operator):
# if true, run clean install - ie remove all files before adding new
# equivalent to deleting the addon and reinstalling, except the
# updater folder/backup folder remains
clean_install = bpy.props.BoolProperty(
clean_install: bpy.props.BoolProperty(
name="Clean install",
description="If enabled, completely clear the addon's folder before installing new update, creating a fresh install",
default=False,
Expand Down Expand Up @@ -321,7 +321,7 @@ def target_version(self, context):
i+=1
return ret

target = bpy.props.EnumProperty(
target: bpy.props.EnumProperty(
name="Target version to install",
description="Select the version to install",
items=target_version
Expand All @@ -330,7 +330,7 @@ def target_version(self, context):
# if true, run clean install - ie remove all files before adding new
# equivalent to deleting the addon and reinstalling, except the
# updater folder/backup folder remains
clean_install = bpy.props.BoolProperty(
clean_install: bpy.props.BoolProperty(
name="Clean install",
description="If enabled, completely clear the addon's folder before installing new update, creating a fresh install",
default=False,
Expand Down Expand Up @@ -388,7 +388,7 @@ class addon_updater_install_manually(bpy.types.Operator):
bl_description = "Proceed to manually install update"
bl_options = {'REGISTER', 'INTERNAL'}

error = bpy.props.StringProperty(
error: bpy.props.StringProperty(
name="Error Occurred",
default="",
options={'HIDDEN'}
Expand Down Expand Up @@ -450,7 +450,7 @@ class addon_updater_updated_successful(bpy.types.Operator):
bl_description = "Update installation response"
bl_options = {'REGISTER', 'INTERNAL', 'UNDO'}

error = bpy.props.StringProperty(
error: bpy.props.StringProperty(
name="Error Occurred",
default="",
options={'HIDDEN'}
Expand Down
2 changes: 1 addition & 1 deletion grease_pencil.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ConnectStrokes(Operator):
bl_label = "connect strokes"
bl_options = {"REGISTER", "UNDO"}

point_dist = FloatProperty(min=0.001, default=.8)
point_dist: FloatProperty(min=0.001, default=.8)

def execute(self, context):
process_gp_layer(self.point_dist)
Expand Down
40 changes: 20 additions & 20 deletions nodes/branch_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@
class MtreeBranch(Node, BaseNode):
bl_label = "Branch Node"

seed = IntProperty(update = BaseNode.property_changed)
advanced_settings = BoolProperty(default=False, update = BaseNode.property_changed) # show advanced properties
amount = IntProperty(min=0, default=20, update = BaseNode.property_changed) # number of splits
split_angle = FloatProperty(min=0, max=1.5, default=.6, update = BaseNode.property_changed) # angle of a fork
max_split_number = IntProperty(min=0, default=3, update = BaseNode.property_changed) # number of forks per split
radius = FloatProperty(min=0, max=1, default=.6, update = BaseNode.property_changed) # radius of split
end_radius = FloatProperty(min=0, max=1, default=0, update = BaseNode.property_changed)
min_height = FloatProperty(min=0, max=.999, default=.1, name="start", update = BaseNode.property_changed) # min height at which a split occurs
seed: IntProperty(update = BaseNode.property_changed)
advanced_settings: BoolProperty(default=False, update = BaseNode.property_changed) # show advanced properties
amount: IntProperty(min=0, default=20, update = BaseNode.property_changed) # number of splits
split_angle: FloatProperty(min=0, max=1.5, default=.6, update = BaseNode.property_changed) # angle of a fork
max_split_number: IntProperty(min=0, default=3, update = BaseNode.property_changed) # number of forks per split
radius: FloatProperty(min=0, max=1, default=.6, update = BaseNode.property_changed) # radius of split
end_radius: FloatProperty(min=0, max=1, default=0, update = BaseNode.property_changed)
min_height: FloatProperty(min=0, max=.999, default=.1, name="start", update = BaseNode.property_changed) # min height at which a split occurs

length = FloatProperty(min=0, default=7, update = BaseNode.property_changed) # length of trunk
shape_start = FloatProperty(min=0, default=1, update = BaseNode.property_changed) # length at the base of the tree
shape_end = FloatProperty(min=0, default=1, update = BaseNode.property_changed) # length at the end of the tree
shape_convexity = FloatProperty(default=.3, update = BaseNode.property_changed) # how curved the length will be in function of the height of the branch
resolution = FloatProperty(min=.002, default=1, update = BaseNode.property_changed) # how many loops a branch has
randomness = FloatProperty(default=.15, update = BaseNode.property_changed) # how unregular the branches look
split_proba = FloatProperty(min=0, max=1, default=.1, update = BaseNode.property_changed) # how likely is a branch to fork
split_flatten = FloatProperty(min=0, max=1, default=.5, update = BaseNode.property_changed) # how constraint on the horizontal axis the splits are
can_spawn_leafs = BoolProperty(default=True, update = BaseNode.property_changed)
gravity_strength = FloatProperty(default=.3, update = BaseNode.property_changed) # how much branches go towards the floor/sky
floor_avoidance = FloatProperty(min=0, default=1, update = BaseNode.property_changed) # how much the branches avoid the floor
length: FloatProperty(min=0, default=7, update = BaseNode.property_changed) # length of trunk
shape_start: FloatProperty(min=0, default=1, update = BaseNode.property_changed) # length at the base of the tree
shape_end: FloatProperty(min=0, default=1, update = BaseNode.property_changed) # length at the end of the tree
shape_convexity: FloatProperty(default=.3, update = BaseNode.property_changed) # how curved the length will be in function of the height of the branch
resolution: FloatProperty(min=.002, default=1, update = BaseNode.property_changed) # how many loops a branch has
randomness: FloatProperty(default=.15, update = BaseNode.property_changed) # how unregular the branches look
split_proba: FloatProperty(min=0, max=1, default=.1, update = BaseNode.property_changed) # how likely is a branch to fork
split_flatten: FloatProperty(min=0, max=1, default=.5, update = BaseNode.property_changed) # how constraint on the horizontal axis the splits are
can_spawn_leafs: BoolProperty(default=True, update = BaseNode.property_changed)
gravity_strength: FloatProperty(default=.3, update = BaseNode.property_changed) # how much branches go towards the floor/sky
floor_avoidance: FloatProperty(min=0, default=1, update = BaseNode.property_changed) # how much the branches avoid the floor


properties = ["seed", "amount", "split_angle", "max_split_number", "radius", "end_radius", "min_height", "length", "shape_start", "shape_end",
Expand Down Expand Up @@ -61,4 +61,4 @@ def execute(self, tree, input_node):
links = output.links
if len(links) > 0:
links[0].to_node.execute(tree, self)


32 changes: 16 additions & 16 deletions nodes/grow_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
class MtreeGrow(Node, BaseNode):
bl_label = "Grow Node"

seed = IntProperty()
length = FloatProperty(min=0, default=7, update = BaseNode.property_changed) # length of trunk
shape_start = FloatProperty(min=0, default=.5, update = BaseNode.property_changed) # length at the base of the tree
shape_end = FloatProperty(min=0, default=.5, update = BaseNode.property_changed) # length at the end of the tree
shape_convexity = FloatProperty(default=1, update = BaseNode.property_changed) # how curved the length will be in function of the height of the branch
resolution = FloatProperty(min=.002, default=1, update = BaseNode.property_changed) # how many loops a branch has
randomness = FloatProperty(default=.1, update = BaseNode.property_changed) # how unregular the branches look
split_proba = FloatProperty(min=0, max=1, default=.1, update = BaseNode.property_changed) # how likely is a branch to fork
split_angle = FloatProperty(min=0, max=1, default=.3, update = BaseNode.property_changed) # angle of a fork
split_radius = FloatProperty(min=0, max=1, default=.9, update = BaseNode.property_changed) # radius of forked branches
split_flatten = FloatProperty(min=0, max=1, default=.5, update = BaseNode.property_changed) # how constraint on the horizontal axis the splits are
end_radius = FloatProperty(min=0, max=1, default=0, update = BaseNode.property_changed) # the relative radius of vranches at the end of growth
can_spawn_leafs = BoolProperty(default=True, update = BaseNode.property_changed)
gravity_strength = FloatProperty(default=.1, update = BaseNode.property_changed) # how much branches go towards the floor/sky
floor_avoidance = FloatProperty(min=0, default=1, update = BaseNode.property_changed) # how much the branches avoid the floor
seed: IntProperty()
length: FloatProperty(min=0, default=7, update = BaseNode.property_changed) # length of trunk
shape_start: FloatProperty(min=0, default=.5, update = BaseNode.property_changed) # length at the base of the tree
shape_end: FloatProperty(min=0, default=.5, update = BaseNode.property_changed) # length at the end of the tree
shape_convexity: FloatProperty(default=1, update = BaseNode.property_changed) # how curved the length will be in function of the height of the branch
resolution: FloatProperty(min=.002, default=1, update = BaseNode.property_changed) # how many loops a branch has
randomness: FloatProperty(default=.1, update = BaseNode.property_changed) # how unregular the branches look
split_proba: FloatProperty(min=0, max=1, default=.1, update = BaseNode.property_changed) # how likely is a branch to fork
split_angle: FloatProperty(min=0, max=1, default=.3, update = BaseNode.property_changed) # angle of a fork
split_radius: FloatProperty(min=0, max=1, default=.9, update = BaseNode.property_changed) # radius of forked branches
split_flatten: FloatProperty(min=0, max=1, default=.5, update = BaseNode.property_changed) # how constraint on the horizontal axis the splits are
end_radius: FloatProperty(min=0, max=1, default=0, update = BaseNode.property_changed) # the relative radius of vranches at the end of growth
can_spawn_leafs: BoolProperty(default=True, update = BaseNode.property_changed)
gravity_strength: FloatProperty(default=.1, update = BaseNode.property_changed) # how much branches go towards the floor/sky
floor_avoidance: FloatProperty(min=0, default=1, update = BaseNode.property_changed) # how much the branches avoid the floor

properties = ["seed", "length", "shape_start", "shape_end", "shape_convexity", "resolution", "randomness",
"split_proba", "split_angle", "split_radius", "split_flatten", "end_radius", "can_spawn_leafs", "gravity_strength", "floor_avoidance"]
Expand Down Expand Up @@ -49,4 +49,4 @@ def execute(self, tree, input_node):
links = output.links
if len(links) > 0:
links[0].to_node.execute(tree, self)


8 changes: 4 additions & 4 deletions nodes/node_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class MtreeNodeTree(NodeTree):
bl_label = "Mtree Node Tree"
bl_icon = 'NODETREE'

preset_to_load = EnumProperty(name = "Presets", items = get_preset_list, description = "presets")
preset_to_save = StringProperty(name="name", default="default tree")
preset_to_load: EnumProperty(name = "Presets", items = get_preset_list, description = "presets")
preset_to_save: StringProperty(name="name", default="default tree")

def save_as_json(self, return_string=False):
''' save node tree information in a json file '''
Expand Down Expand Up @@ -155,8 +155,8 @@ class MtreeSaveLoadPreset(Operator):
bl_label = " Save or Load Preset"
bl_options = {"REGISTER", "UNDO"}

node_group_name = StringProperty()
load = BoolProperty(default=False)
node_group_name: StringProperty()
load: BoolProperty(default=False)

def execute(self, context):
node_tree = bpy.data.node_groups[self.node_group_name] # get node tree
Expand Down
12 changes: 6 additions & 6 deletions nodes/root_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
class MtreeRoots(Node, BaseNode):
bl_label = "Roots Node"

seed = IntProperty(default=9, update = BaseNode.property_changed)
length = FloatProperty(min=0, default=14, update = BaseNode.property_changed) # length of trunk
resolution = FloatProperty(min=.002, default=2, update = BaseNode.property_changed) # how many loops the trunk has
split_proba = FloatProperty(min=0, max=1, default=.2, update = BaseNode.property_changed)
randomness = FloatProperty(min=0, max=0.5, default=.2, update = BaseNode.property_changed)
seed: IntProperty(default=9, update = BaseNode.property_changed)
length: FloatProperty(min=0, default=14, update = BaseNode.property_changed) # length of trunk
resolution: FloatProperty(min=.002, default=2, update = BaseNode.property_changed) # how many loops the trunk has
split_proba: FloatProperty(min=0, max=1, default=.2, update = BaseNode.property_changed)
randomness: FloatProperty(min=0, max=0.5, default=.2, update = BaseNode.property_changed)

properties = ["seed", "length", "resolution", "split_proba", "randomness"]

Expand All @@ -28,4 +28,4 @@ def execute(self, tree, input_node):
random.seed(self.seed)
creator = self.id_data.nodes.find(self.name) # get index of node in node tree and use it as tree function identifier

tree.roots(self.length, self.resolution, self.split_proba, self.randomness, creator)
tree.roots(self.length, self.resolution, self.split_proba, self.randomness, creator)
16 changes: 8 additions & 8 deletions nodes/split_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
class MtreeSplit(Node, BaseNode):
bl_label = "Split Node"

seed = IntProperty(update = BaseNode.property_changed)
amount = IntProperty(min=0, default=20, update = BaseNode.property_changed) # number of splits
split_angle = FloatProperty(min=0, max=1.5, default=.6, update = BaseNode.property_changed) # angle of a fork
max_split_number = IntProperty(min=0, default=3, update = BaseNode.property_changed) # number of forks per split
radius = FloatProperty(min=0, max=1, default=.6, update = BaseNode.property_changed) # radius of split
start = FloatProperty(min=0, max=.999, default=0.3, name="start", update = BaseNode.property_changed) # min height at which a split occurs
end = FloatProperty(min=0, max=1, default=1, update = BaseNode.property_changed)
seed: IntProperty(update = BaseNode.property_changed)
amount: IntProperty(min=0, default=20, update = BaseNode.property_changed) # number of splits
split_angle: FloatProperty(min=0, max=1.5, default=.6, update = BaseNode.property_changed) # angle of a fork
max_split_number: IntProperty(min=0, default=3, update = BaseNode.property_changed) # number of forks per split
radius: FloatProperty(min=0, max=1, default=.6, update = BaseNode.property_changed) # radius of split
start: FloatProperty(min=0, max=.999, default=0.3, name="start", update = BaseNode.property_changed) # min height at which a split occurs
end: FloatProperty(min=0, max=1, default=1, update = BaseNode.property_changed)
properties = ["seed", "amount", "split_angle", "max_split_number", "radius", "start", "end"]


Expand All @@ -38,4 +38,4 @@ def execute(self, tree, input_node):
links = output.links
if len(links) > 0:
links[0].to_node.execute(tree, self)


Loading