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

terrain analysis errors #912

Open
vac9181 opened this issue Jul 15, 2024 · 3 comments
Open

terrain analysis errors #912

vac9181 opened this issue Jul 15, 2024 · 3 comments

Comments

@vac9181
Copy link

vac9181 commented Jul 15, 2024

Blender and OS versions

Operating system: win11 64bit

Blender Version
4.1.1

Describe the bug
trying to make a dem and trying to use the terrain analysis i get two errors

How to Reproduce
use the node menu in gis and click terrain analysis

Error message

Python: Traceback (most recent call last):
File "C:\Users\Ian\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\BlenderGIS-master\operators\nodes_terrain_analysis_builder.py", line 71, in execute
scaleNodesGroupTree.inputs.new('NodeSocketFloat','val')
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ShaderNodeTree' object has no attribute 'inputs'

Python: Traceback (most recent call last):
File "C:\Users\Ian\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\BlenderGIS-master\operators\nodes_terrain_analysis_builder.py", line 63, in execute
scaleNodesGroupTree.inputs.clear()
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ShaderNodeTree' object has no attribute 'inputs'

@vac9181
Copy link
Author

vac9181 commented Jul 17, 2024

anyone know a work around for this or is it a case of waiting for him to fix it?

@Joe-Maz
Copy link

Joe-Maz commented Aug 8, 2024

Hi,
Had the same problem when using blender 4.1 because they changed a few things. I looked into it and changed a few things for myself in a file named: nodes_terrain_analysis_builder.py

I have pasted what I changed and you can try it for yourself.

Copy and paste this between lines 59 & 77 in your file located:

C:\Users\You\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\BlenderGIS-master\operators.

Make a copy of the original just in case.

#groupsTree.remove(groupsTree['Normalize'])
			scaleNodesGroupTree = groupsTree['Normalize']
			scaleNodesGroupTree.nodes.clear()
			scaleNodesGroupTree.interface.clear()
		else:
			scaleNodesGroupTree = groupsTree.new('Normalize', 'ShaderNodeTree') # = bpy.types.node_tree
		scaleNodesGroupName = scaleNodesGroupTree.name #Normalize.001 if normalize already exists
		#  group inputs
		scaleInputsNode = scaleNodesGroupTree.nodes.new('NodeGroupInput')
		scaleInputsNode.location = (-350,0)
		scaleNodesGroupTree.interface.new_socket(name='val', in_out='INPUT', socket_type='NodeSocketFloat')
		scaleNodesGroupTree.interface.new_socket(name='min', in_out='INPUT', socket_type='NodeSocketFloat')
		scaleNodesGroupTree.interface.new_socket(name='max', in_out='INPUT', socket_type='NodeSocketFloat')
		#  group outputs
		scaleOutputsNode = scaleNodesGroupTree.nodes.new('NodeGroupOutput')
		scaleOutputsNode.location = (300,0)
		scaleNodesGroupTree.interface.new_socket(name='val', in_out='OUTPUT', socket_type='NodeSocketFloat')

Hope it works for you!

@vac9181
Copy link
Author

vac9181 commented Aug 8, 2024

you sir just fixed it for me thank you . it wasn't working i tried doing it 4 times and i was getting an error about line 71 but it turns out i had opened 4.1 and was adding your fix to that blender and not 4.2 LOL but 4.2 is all working now thanks again

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