#Condition for adding action to MenuBar

13 messages · Page 1 of 1 (latest)

slim elbow
#

If I want to add a condition which doesn't add a action to the Menu bar if the format is an image format, would this if statement not work? I feel like I've seen it before but now I can't remember where.

timber mesa
#

should be

MenuBar.addAction({
  ...
  condition: () => Format?.id != "image"
}, ...)
slim elbow
#

Thank you

timber mesa
#

!close

hot sealBOT
#

Channel closed ----------

slim elbow
# timber mesa !close

Do you know if there is some documentation of what the format IDs are? Because I'm trying to make a plugin only become available in a generic model, but apparently generic isn't the ID

#

I used condition: {features: ['meshes']} - I guess that's the best in my case?

timber mesa
#

Generic has an id that is called 'free' in code. You can use condition: {formats: ['free']} or condition: () => Format && Format.id == 'free'

slim elbow
#

Alright thanks again - got everything working

#

!close

hot sealBOT
#

Channel closed ----------

halcyon cargo