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

'NoneType' object is not callable error in Blender 4.1.1 #53

Open
Eugenexz opened this issue Apr 27, 2024 · 1 comment
Open

'NoneType' object is not callable error in Blender 4.1.1 #53

Eugenexz opened this issue Apr 27, 2024 · 1 comment

Comments

@Eugenexz
Copy link

Getting the below error when trying to run the sample code in Blender 4.1.1

from geometry_script import *

@tree("Repeat Grid")
def repeat_grid(geometry: Geometry, width: Int, height: Int):
    g = grid(
        size_x=width, size_y=height,
        vertices_x=width, vertices_y=height
    ).mesh_to_points()
    return g.instance_on_points(instance=geometry)
Python: Traceback (most recent call last):
  File "/Text", line 3, in <module>
  File "/Users/eugene/Library/Application Support/Blender/4.1/scripts/addons/geometry-script-main/api/tree.py", line 136, in build_tree
    outputs = builder(**builder_inputs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Text", line 8, in repeat_grid
TypeError: 'NoneType' object is not callable
@jlaaser
Copy link

jlaaser commented Nov 20, 2024

Ran into this issue while trying to get Geometry Script running in Blender 4.2. If anyone else has this problem, the solution is to add ".mesh" between the grid(...) and .mesh_to_points

The following works in Blender 4.2:

from geometry_script import *

@tree("Repeat Grid")
def repeat_grid(geometry: Geometry, width: Int, height: Int):
    g = grid(
        size_x=width, size_y=height,
        vertices_x=width, vertices_y=height
    ).mesh.mesh_to_points()
    return g.instance_on_points(instance=geometry)

It looks like the outputs of the "Grid" node have been updated since the documentation was written (documentation shows only a "Mesh" output, but a newly-created Grid node in Blender 4.2 shows both a "Mesh" output and a "UV Map" output). Since, per the documentation,

If the node has a single output, return the socket type, otherwise return an object with properties for each output name.

the output to use for the next step needs to be specified/extracted from the returned object before it can be used. Might be useful to update the example script to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants