baldingwizard / Blender-Addons

119 stars 20 forks source link

Can this work in Blender 3.1.x ... it's giving an error #14

Closed stillpointx closed 2 years ago

stillpointx commented 2 years ago

Can this work in Blender 3.1.x Geometry nodes window? ... it's giving an error in other windows as well.

Python: Traceback (most recent call last):
  File "/home/rt/.config/blender/3.1/scripts/addons/MathsExpressionBlender28/dynamic_maths_expression_node.py", line 231, in invoke
    return wm.invoke_props_dialog(self, width=viewWidth)
TypeError: WindowManager.invoke_props_dialog(): error with keyword argument "width" -  Function.width expected an int type, not float

location: <unknown location>:-1

image

nalgapupusas commented 2 years ago

I'm not sure how active Rich is with this add on now, but a quick fix is to go to line 168 of 'dynamic_maths_expression_node.py' and change *viewWidth = bpy.context.area.width 0.8 to viewWidth = bpy.context.area.width* (remove the 0.8). This keeps the expected variable as an int instead of a float.

fabiangarga commented 2 years ago

Should also work if you keep the value to multiply and do viewWidth = int(bpy.context.area.width * 0.8). But in my case it is still throwing the error.

nalgapupusas commented 2 years ago

Yeah, I would think that that would work as well. I'm not sure why that would still show an error.

baldingwizard commented 2 years ago

Yeah - both of those should work fine, and for me it’s working using the ‘int(…)’ function with the 0.8 still in there… not sure why you’re still getting an error. Is it the same message?

dalamajama commented 2 years ago

I got this error and I fixed it by casting it to an int() and also removing the 0.8. Neither of those worked on their own but both of them at the same time were a fix for me.

baldingwizard commented 2 years ago

I've uploaded version 2.02 beta which includes support for Blender 3.1+ and the different node systems - Shader, Geometry, Compositor - allowing for different presets in each (along with a 'Test' preset for each). Also, provide a 'Convert to text block' button to allow an expression (eg, a preset) to be transferred into a text block for easy editing.