The issue is that when you use the regular UI, the modifier gets passed to operators automatically. But in this case, it has to be passed manually.
row.operator(“remesh.csg_move_up”, text="", icon=“TRIA_UP”).index = i
has to be changed to this:
csg_move_up = row.operator(“remesh.csg_move_up”, text="", icon=“TRIA_UP”)
csg_move_up. modifier = “modifier name”
csg_move_up.index = i
So yea, I can make it work by using a custom layout for this modifier in the sculpt branch. But the downside is that if eg. a new button would be added, you wouldn’t see that button because it wouldn’t be in the custom layout (until I update that). I’m already doing that with several other modifiers but this is probably more likely to change than the others? Maybe I should just add some warning and keep an eye for possible changes.
I’ll add this to my To Do list for the next version (which I should start developing at some point…).