Creating objects by scripting in presentation mode

Aug 18, 2010 at 8:09pm

Creating objects by scripting in presentation mode

I’ve been re-working Leafcutter john’s Framework patch, which creates/loads/connects bpatchers by scripting, but come up against a problem now I want to tidy things up by using presentation mode; newly created bpatchers are not appearing in presentation mode – presumably they need to be created with some kind of ‘added-to-presentation’ attribute, but I don’t see anything about this in the scripting messages to thispatcher.
Ah.
I’ve just this minute seen the note about creating new objects with thispatcher being not supported in Max 5. Creating objects by scripting messages to thispatcher certainly works in Max 5, but I guess the presentation thing is a problem…? Bummer, if so.
cheers
Roger

#51859
Aug 18, 2010 at 10:15pm

Hi Roger,

Does this do what you want?

script newobject bpatcher @name {your patch} @presentation 1

#186111
Aug 19, 2010 at 11:31am

Yes, and you’re right, it does work! I actually found this out by trial and error, but got some weird results on the way, because I put the ‘@presentation 1′ in the wrong place.
So what’s all this about creating new objects via thispatcher being ‘not supported’ in Max 5? I notice there’s nothing to that effect in the thispatcher.help file, but it does say so at the top of the thispatcher ref page. Is this anything we should worry about, or can I go on with this project without fear that it will all stop working in a couple of updates time?
cheers
Roger

#186112
Aug 19, 2010 at 1:37pm

This is in reference to older Max versions that permitted the creation of objects via “cryptic” messages other than scripting. I copied this from the Max 4.6 reference:

(others) thispatcher will respond to messages to create new objects. The format of these messages is cryptic and subject to change, but you can get some idea of what might be worth trying by examining a patcher file as text, and trying any of the messages that begin with #P. Leave the #P out of the message you send to thispatcher. Use of thispatcher to create new objects is not supported.

But I admit that the statement in the Max 5 help file is highly confusing, particularly to those that have never used those “cryptic” messages to create new objects, and should probably be either removed or expanded.

#186113
Aug 19, 2010 at 1:41pm

But wait, I’m just realizing that it says the same thing even in the Max 4.6 reference:
Use of thispatcher to create new objects is not supported.

That definitely makes little sense now.

#186114
Aug 19, 2010 at 10:21pm

I wondered about that too. Is it that one could potentially get into all kinds of trouble making new objects and connecting them programatically? Like 5,000 bangs which are connected at random?? :)

Anyway, it does work, but that caveat is definitely misleading. Would the same be said about using JS to create new objects?

#186115

You must be logged in to reply to this topic.