TLDR:
-fluid.objects
don’t respond to “generic” attributes (varname
, patching_rect
, etc…)
-can’t script/connect fluid.objects
as a result
-not sure how to script the creation of an object with wildcards & additional attributes (@fixwidth 1
)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
So building something using fluid.nmfilter~
and I’d like to have it be (behind-the-scenes) dynamically sizeable.
My initial thought was to just make a max amount of components I may want (say 16), and then mc.pack~
and deal with the empty channels later on.
Turns out that that’s really expensive as fluid.nmffilter~
does it’s thing whether or not there’s stuff in those channels, making fluid.nmffilter~ 16
expensive, just sitting there.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
SO
I wanted to dust off some of the oldschool/arcane magic and script object creation, movement, connecting etc… to basically make something like this:
What’s in the red.
In trying to do this I’m running into a couple problems.
One is a more general Max one where I don’t know how to instantiate the object while having wildcards (#0
) in the name AND still set general/global attributes after (@fixwidth 1
so it’s not all smooshed up).
So I can do this:
script newobject fluid.nmffilter~ 16 @bases sorted @fftsettings 512 64 512 @maxfftsize 2048 @maxcomponents 16 @maxmaxcomponents 16
but that creates a really smooshed thing:
Ok, I can put the stuff in a @text
attribute, and then shove the @fixwidth 1
at the end, like so:
script newobject newobj @text "fluid.nmffilter~ 16 @bases sorted @fftsettings 512 64 512 @maxfftsize 2048 @maxcomponents 16 @maxmaxcomponents 16" @fixwidth 1
That works, but I can no longer wildcard the amount of components (16
s in this example).
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
BUT
All of this is moot when I realized that for some reason, I can’t set the varname
of fluid.nmffilter~
other than manually typing it into the info pane.
If I send varname foo
to fluid.nmffilter~
I get:
This appears to be the case for all the “generic” attributes (patching_rect
, etc…).
Is this intentional or a bug/oversight?
The reason this is important in this case is because the objects need to have scripting names to be able to script connections between them (e.g. script connect foo 0 bar 0
). So if I can’t dynamically create a fluid.nmffilter~
with a scripting name attached, I can’t go forward and make connections between it and subsequent objects.
edit:
Initially made this as “Usage Question” category, but I think the attribute problem seems more important, so changed it to “Bug Reports” instead.