geometry-script
geometry-script copied to clipboard
Does not work for me on Blender 3.6
I just installed the addon from your latest zip, copy pasted the Repeat Grid
example into the Blender Text Editor and tried to run it. Unfortunately I got an error:
Error: Python: Traceback (most recent call last):
File "/Repeat Grid.py", line 5, in <module>
File "/Users/robertosaccon/Library/Application Support/Blender/3.6/scripts/addons/geometry-script-main/api/tree.py", line 41, in build_tree
node_group.is_modifier = True
AttributeError: 'GeometryNodeTree' object has no attribute 'is_modifier'
did I do anything wrong ?
update: tried the other examples, same error.
The latest merge has breaking changes due to moving from Blender 3.6 -> 4.0. For Blender 3.6 you can download the previous version.
We should probably add version checks for 4.0 specific changes
Thanks a lot, the previous version works perfectly. Now I am gonna deep dive into it. Yeah, version checks would be great, I anticipate more people like me have to stick to Blender 3.6 for now (I have a 2013 Macbook Pro, where Blender >= 4.0 does not run anymore).
@carson-katri Hmm... how about something like this in tree.py
?
def check_version(min_major, min_minor, min_patch):
major, minor, patch = bpy.app.version
if (major, minor, patch) < (min_major, min_minor, min_patch):
raise Exception(f"Your Blender version {major}.{minor}.{patch} is not compatible. "
f"Geometry Script now requires at least Blender {min_major}.{min_minor}.{min_patch}. "
f"Please update Blender or install a previous version of Geometry Script.")
def tree(name):
check_version(4, 0, 0)
...
def build_tree(builder):
...
@alphadito I meant backwards compatibility, so we could switch back to the 3.x method as needed. This means we could still fix bugs or provide new API for older versions.
Could optionally create custom abstractions that expose a unified API for all versions.
@carson-katri Ah yep I initially tried to do a bit of monkey patching for backwards compatibility but the bpy.types.GeometryNodeTree class appears to have a read only __ slots __ attribute defined so you can't just mutate the blender 3.6 object to have 4.0 attribute names.
Perhaps we could make a wrapper class?
class NodeGroupWrapper:
def __init__(self,nodegroup,version):
self.nodegroup = nodegroup
self.version = version
@property
def inputs(self):
if self.version[0] < 4:
return self.nodegroup.inputs
else:
return [i for i in self.nodegroup.interface.items_tree if i.item_type == 'SOCKET' and i.in_out == 'INPUT']
Could we have different documentation for each of the blender versions? Because many things there aren't working in the current version of blender. For example, I didn't manage to return multiple values on the node tree unless I use the yield keyword. In the current documentation it says that I should be able to use a dictionary, but it won't work