Skip to content

CSPolygon3D.depth doesn't respect interface/inspector/default_float_step #108105

Open
@goatchurchprime

Description

@goatchurchprime

Tested versions

  • Reproducible in 4.4.1.stable

System information

Godot v4.4.1.stable unknown - cpe:/o:nixos:nixos:25.05 #1-NixOS SMP PREEMPT_DYNAMIC Thu Apr 10 12:39:41 UTC 2025 on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) - 12th Gen Intel(R) Core(TM) i5-1240P (16 threads)

Issue description

The problem line is here:
https://github.com/godotengine/godot/blob/e1b4101e3460dd9c6ba0b7f8d88e9751b8383f5b/modules/csg/csg_shape.cpp#L2614C1-L2614C144

ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_RANGE, "0.01,100.0,0.01,or_greater,exp,suffix:m"), "set_depth", "get_depth");

It should probably be the equivalent of (because this is completely wrong):

double default_float_step = EDITOR_GET("interface/inspector/default_float_step");
char buffer [500];
sprintf(buffer, "%f,100.0,%f,or_greater,exp,suffix:m",default_float_step,default_float_step); 
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_RANGE, buffer), "set_depth", "get_depth");

I hit this problem while doing some CSG boolean subtractions on an imported mesh where I require millimeter precision.

If I use a CSGBox3D the dimensions are defined by Vector3 values for which the editor respects default_float_step.

But if I need a little more control on the XY profile than letting it only be a rectangle then I am not allowed to have the same precision for its depth, even though the XY points are controlled by to the default_float_step precision.

Steps to reproduce

Make a CSGPolygon3D node, edit the Depth property to say 0.056 and confirm that it is set to 0.06, even when read from GDScript code.

Minimal reproduction project (MRP)

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    For team assessment

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions