Is there a go-to way to create a custom parameter for attribute selection? What I’m looking for would be the same parameter like the inputattrscope on the mathPOP but with the preexisting menuNames etc. (including the built-in attributes like _PointI).
I’ve tried referencing a paramerer like this for the menuSource, but it’s not updating correctly
I’m not super familiar with POP attributes, but TDFunctions.parMenu lets you create a menu from lists on the fly if that’s helpful. You can use that function in the menuSource if you can get a list of the attributes you want. If you can’t get that list easily, if you provide an example of what you want, I can get it to the right dev…
I’ve tried doing it with python before. I think I couldn’t get the dependencies set up correctly, such that new attributes weren’t available after input changed.
If you can give me an example file with that I can probably get the data to be properly updated.
Hi Jossef try this:
```python
# Execute DAT inside the comp, Frame Start ON
SRC = ‘attr_menu’ # the Attribute POP wired to your input
OWNER = parent() # the comp holding your custom StrMenu
_sig = None
def _refresh():
global \_sig
src = OWNER.op(SRC)
if not src:
return
src.cook(force=True) # rebuild the native attribute menu
sig = tuple((p.name, tuple(p.menuNames)) for p in src.pars() if p.menuNames)
if sig != \_sig: # only when the attrs actually changed
\_sig = sig
OWNER.cook(force=True) # makes the menuSource StrMenu re-pull
def onFrameStart(frame):
if frame % 30 == 0: # attrs change rarely, no need every frame
\_refresh()
return
```
I find this quite unsatisfying. I think a menuSource reference to a respective menu inside the COMP should pull the attributes correctly.
I’ll build an example @Ivan
Here’s an example. If you add a new attribute to the pointPOP, it’s not shown in the custom attribute’s dropdown menu. Even though that one has op(‘./math1’).par.inputattrscope as menuSource, which updates correctly when inspected
example.tox (1.0 KB)
Ah I see. I’ll put this in the bug queue. Thanks for the clear example!
Tested in latest version in development and this is already fixed there, so should be all good in the next release. I will also try to get the submenu working in custom parameters