Justin Rhoades

Justin Rhoades

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Python Error while dividing: TypeError: unsupported operand type(s) for /: 'int' and 'NoneType' May 11, 2018, 8:07 p.m.

Thank you both. You were absolutely correct on these issues. Thank you for the quick reply sorry I was slow to respond

Python Error while dividing: TypeError: unsupported operand type(s) for /: 'int' and 'NoneType' May 11, 2018, 12:54 a.m.

So I'm working on a tool that requires me to do some divisions of variables. I ran a test version in the Python Shell window and it worked just as I expected but when I run it in my Python node I get an error when I apply it. Here is the code and error

node = hou.pwd()
geo = node.geometry()

hairs = list(geo.prims())
hair_count = len(hairs) - 1

node_percent = hou.node("/obj/geo1/Percent")

percent = node_percent.parm("Percent")

threshold = int((hair_count / percent) / hair_count)

Error:       Python error: Traceback (most recent call last):
File "<stdin>", line 11, in <module>
TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'

Does anyone have an idea why this would happen?

Thank you in advance