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

Transpiler creates wrong floor node #390

Open
Midon99 opened this issue Dec 19, 2024 · 3 comments
Open

Transpiler creates wrong floor node #390

Midon99 opened this issue Dec 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Midon99
Copy link

Midon99 commented Dec 19, 2024

Describe the bug

Transpiler creates for a math floor node a input_kwargs with two parameters. Floor needs only one which then throws an error at code execution

Attempted to use (input_socket.name='Value',input_socket.type='VALUE') of node.name='Math.005', but it was disabled. Either change attrs={...}, change the socket index, or specify the socket by name (assuming two enabled sockets don't share a name).The input sockets are [('Value', 'VALUE', 'ENABLED'), ('Value', 'VALUE', 'DISABLED'), ('Value', 'VALUE', 'DISABLED')

In my case this is the line

floor = nw.new_node(Nodes.Math, input_kwargs={0: subtract, 1: 2.00000 }, attrs={'operation': 'FLOOR'})

The correct code working code is

floor = nw.new_node(Nodes.Math, input_kwargs={0: subtract }, attrs={'operation': 'FLOOR'})

Steps to Reproduce

Create a geometry floor node and run the transpiler

What version of the code were you using?

e254428

Platform

  • OS & OS Version: Ubuntu 24.04.1
  • Python 3.11.10
  • RAM (GB): 64 GB

Additional context

Not tested, but could this a problem for all one parameter math nodes?

@Midon99 Midon99 added the bug Something isn't working label Dec 19, 2024
@araistrick
Copy link
Contributor

Thanks for the report, I will fix this.

As a workaround, if you create a fresh node and switch it to a floor without editing any sockets first, it will likely avoid this. This error usually happens because internally the floor node still has the edited input from a prior use and my code detects this and reports it, even though blender actually ignores the input

1 similar comment
@araistrick
Copy link
Contributor

Thanks for the report, I will fix this.

As a workaround, if you create a fresh node and switch it to a floor without editing any sockets first, it will likely avoid this. This error usually happens because internally the floor node still has the edited input from a prior use and my code detects this and reports it, even though blender actually ignores the input

@Midon99
Copy link
Author

Midon99 commented Dec 19, 2024

Thanks for the info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants