warp icon indicating copy to clipboard operation
warp copied to clipboard

[REQ] Allow referencing Enum values inside kernels directly

Open mmacklin opened this issue 10 months ago • 0 comments

Description

We should be able to directly reference Python enum values inside Warp kernels. Currently this is only possible doing things like:

if foo == wp.static(JointType.FREE.value):

There also appears to be bugs when referencing enum values inside conditional statements:

```python
@wp.kernel
def foo():
    print(JointType.FREE.value)  # ok
    if int(JointType.FREE.value) == 0:  #ok, but need int(...)
        print("Yes")
    else:
        print("No")

Context

Make Warp kernels more Pythonic and minimize special cases

mmacklin avatar Feb 14 '25 22:02 mmacklin