Motion: Creating an omni-directional rectangle with OSCs

An omni-directional rectangle?



When you first create a rectangle in a Motion project, it can be drawn in any direction. Once the rectangle is created (made an object), it can no longer be edited to extend into negative directions.


This method allows rectangles to be shaped in any direction.


Here's the project (size 1920x1080):


[I am assuming that it is generally known how to link an object's position to OSCs.]


Centering the rectangle between two OSCs is not complicated. Link the rectangle's Position > X parameter to the first OSC Center > X. Then add a new Link and link the rectangle's Position > X parameter to the second OSC Center > X and dial back the Custom Mix to 0.5. Do the same for the rectangle's Position > Y parameters and the OSCs Center > Y parameters.


No matter where you position the OSC pucks, the rectangle will remain exactly half way between the two.


We'll do something similar for the width and height:


Link the rectangle's Shape > Size > Width to the **second** OSC's Center > X parameter, then link the rectangle's Shape > Size > Width to the **first** OSC's Center > X parameter. Set the Apply Mode of the second Link to Add to Source.


This next part will require some explaining...


The Scales of the two Width controlling Links need to have a magnitude of 1.92 [The first width Link +1.92 and the second width Link being subtracted needs to be -1.92*].


Ok - what this is about: The "internal drawing board" of a Motion project is 1000x1000 and be OSC Center values need to be converted to Project Dimensions. Why 1.92? Dialing down the OSC (Pokes in this project) reveals the distance in a value from 0.0 to 1.0 (from the left and bottom edges for X/Y respectively). The values are "distance divided by 1000". Applying a Scale of 1.92 for the width converts 1000 to 1920.


Link the rectangle's Shape > Size > Height parameters in the same fashion.


The Scales of the two Height controlling Links need to be set to 1.08 and -1.08 respectively.


When the Shape > Size dimensions "go negative", Motion stops drawing the Rectangle and it disappears. If we build switches to turn the values positive, and since the Center and Width/Height dimensions will remain accurately calculated, we basically just turn the Rectangle Shape dimensions "inside out".


To do this, we need *two* Numbers generators. In this project they are renamed invWidth and invHeight ("inv" for invert).


ALL we need from these Numbers generators is a +1 or -1 result and when a dimension of the rectangle goes negative, we can multiply it by its matching -1 result to turn it positive... and we need it to switch very quickly (reducing the number of possible values between 1 and -1 to as few as necessary).


To invWidth > Value, add a Link and set the Source Parameter to the *second* OSC Center > X.

Set the Scale to 1000000! (If you need to switch faster - increase these values by factors of 10).

Add *another* Link to invWidth > Value and set the Source Parameter to the *first* OSC Center > X, and set the Apply Mode to Add to Source. Set the Scale to -1000000.


Add a Clamp behavior to the Value parameter and set the Min to -1.0 and the Max to 1.0. This is your switch.


Do the same with invHeight and the Center > Y parameters of the OSCs.


Go back into the Rectangle Shape > Size > Width and add another Link Behavior. To the Source Parameter, add invWidth > Numbers > Value and set the Apply Mode to Multiply by source and set its Scale to 0.1*. Do the same for Rectangle Shape > Size > Height and invHeight.


No matter where you drag the OSC pucks, you should always have a Rectangle (except when width or height equals 0.0! And that, you are likely to have to set manually...)


*Numbers' relationship with various types of parameters throughout the Motion User Interface is a little... interesting... to put it mildly. Often, Numbers values will be 10 times the value displayed in UI parameter elements and will need adjustment (and this isn't all — you will need to learn to recognize WHAT it is you're actually looking at when you use Numbers to "investigate" a parameter's value!)


Hope you have fun with this. Hope you find it educational... you find this stuff through AI (I've looked.) And, I hope you realize that there is a whole lot more to Apple Motion than what you see in the interface!


Y'all come back now — hear?!

Posted on Dec 4, 2025 12:49 PM

Reply

There are no replies.

Motion: Creating an omni-directional rectangle with OSCs

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.