Octopus Manager

Command Editor

Estimated reading: 7 minutes 899 views

Basics

The Command Editor is the main place where most of the magic happens. Here you can set up your actions and here is the place where Octopus runs the maxscript commands.

Each button has its own command settings, which splits up to 4 available commands. (Clicks and Click + Hold)

  • Octopus Menu
    • Octopus Button 1
      • Left Click
      • Right Click
      • Left Click (Hold Mouse Button / Spinner)
      • Right Click (Hold Mouse Button / Spinner)
    • Octopus Button 2
      • Left Click
      • Right Click
      • etc…

Simple Click

The Command Panel of a single click is very simple. It has only 3 properties.

Auto Scene Redraw

Auto Scene Redraw calls the Force Scene Redraw function when all the maxscripts have been executed. This forces all the max viewports to redraw their contents. This is useful when the viewport doesn’t update when your commands has been executed or if you want to have an interactive behaviour.

Hover / Preview

Hover / Preview forces the button to execute its maxscript content when the mouse cursor touches it. This means that you don’t have to click with your mouse to see what will be the outcome of a command.

The Snaps and the Smoothing Octopus menus are using this technique making them fully interactive. The Snaps menu toggles each snapping on or off, while in the Smooth menu, each menu button performs an Auto Smooth based on the predefined values.

Instant Close

This is useful when you are dealing with menus or max tools like, the cut tool or similar. In these cases Octal menu will close first and only after that it will execute the maxscript commands. This prevents the Octal Menu from being kept open and it will give the control to the max tool or menu after it has been closed.

Long Click / Spinner

This is the part where Octopus really shines. A Spinner button can track your mouse movement on each axis, it can handle mouse wheel rotations and you can also set up the behaviour on each axis.

X / Y Adaptive

Turning these on will force Octopus to become adaptive when it returns the movement value from one of the axis. It is useful when you are writing geometry modifying spinners. For example when you are performing a chamfer on a huge object, you obvously need an increased sensitivity. If you have a small object you need a lower sensitivity. Without adaptivity the size of the chamfer would be very small on big objects and it would be extremely huge on small objects.

X / Y Intensity

Intensity is the “per pixel” increment change on an axis. This means if you move your mouse cursor 1 pixel, then it will increment the return value by this value. The beginning point of the click is the center, which is ZERO.

So if you have moved your mouse cursor 10 pixels from the center and your Intensity is 0.05, then the returning value will be 0.5. If the distance is 100, then the returning value is 5.

X / Y Stepping

The stepping parameter is the value of the real increment. If the value is 0.01, then the increment stepping will be the follwing: 0.01, 0.02, 0.03 etc… If the stepping is 0.5, then it will be 0.5, 1.0, 1.5, 2.0 etc… If it’s 10, then 10, 20, 30 etc.

Min / Max Values

These values forces the return values between the Min / Max values. So if the Max value is 100, then it cannot go above that. If the Min value is 0, then it can’t go below 0.

Wheel Default

This value is the default value of the Mouse Wheel (third) parameter.

MaxScript Command Editor

The maxscript command editor is the actual place where all the magic happens. Here is the place where you can write your own maxscripts to control 3ds max. The Single Click and Long Click have their own UI since they have different behaviours. Simple left clicks are just for one time executions, while the Long Click Spinners have their input parameters. Horizontal and Vertical movement and Mouse Wheel.

Single Click

Toggle Return Value

This command must return a True or False value. This controls the state of the button if it’s checked or unchecked. This is just a visual feedback about a toggle switch if it’s on or off.

Maxscript Editor

The maxscript / command editor is the place where you can add your maxscript code. It can be a simple macro or an action. The maxscript editor will execute it.

Long Click

Pre-MaxScript Action

The Pre-MaxScript action is being executed when you long click on a button. This will be executed once.

MaxScript Action

This part is being executed each time you move your mouse or the mouse wheel.

Post-MaxScript Action

The Pre-MaxScript action is being executed when you release the button. This will be executed once.

Dynamic Variables

There are 9 different dynamic variables which are returning different values based on your mouse movements and mouse wheel changes. Also they are monitoring your camera position and direction as well as your selection level.

Mouse Movement

{0} – Horizontal Mouse Move

-- myvar will change each time you move your mouse cursor horizontally
myHorizontalMove = {0}

So if you move your mouse on the horizontal axis by 100 pixels and you stepping is 0.5, while the intensity ia 0.1, then the returning value will be 100 * 0.1 = 10.0

{1} – Vertical Mouse Move

-- myvar will change each time you move your mouse cursor horizontally
myVerticalMove = {1}

So if you move your mouse on the vertical axis by 50 pixels and you stepping is 0.5, while the intensity ia 0.1, then the returning value will be 100 * 0.1 = 5.0

{2} – Mouse Wheel Change

-- myvar will change each time you spin the mouse wheel
myWheelChange = {2}

If you change the mouse wheel it will increment the default value by 1 or -1, based on which direction you are spinning it.

Axis / Direction Dynamic Variables

These variables should be used together. The Axis and Direction variables are representing your local screen space directions on the X, Y, Z axis. This means that you can use these variables to construct screen space based maxscripts. Imagine it as a projection of the 3D space as a 2D representation.

So when I’m saying “HORIZONTAL” then it means your horizontal axis of your viewport, whether it is the X, Y or the Z axis. If we say “VERTICAL” then it can be also any of the axis.

Assume we have rotated our camera this way. In this case the Axis and Directions will be the following:

Axis

The axis dynamic variables are responsible for converting your world space axis to screen space axis.

-- Axis Remap [Horizontal, Vertical, Depth]
-- 1 -> screen space x axis
-- 3 -> screen space y axis
-- 2 -> screen space z depth axis
axis = [1,3,2]

-- When you want to move in screen space vertically
pos = [0,0,0]
pos[{2}] = 10
$.pos = pos

-- The above will expand to
pos = [0,0,0]
pos[3] = 10
-- [0,0,10]
$.pos = pos 

Direction

Direction shows in which direction each axis points to. If it points to left / down / towards the camera, then it’s negative. If points right / up / away from the camera, then it’s positive.

-- Direction Remap
-- screen space X axis -> points to the NEGATIVE direction
-- screen space Y axis -> points to the NEGATIVE direction
-- screen space Z axis -> points to the POSITIVE direction

axis = [-1,-1, 1]

This is also useful for direction conversions, so when one of the axis points to the opposite direction compared to the screen space direction, then using this vairable, you can flip back movement for example. (So when moving an object to the negative direction, but the viewport camera is on the other side, it won’t move to the opposite direction. The object moves to a negative direction but it points to screen space right)

Example code

-- Example of how the values are changing based on the camera positions
-- To check the values, open up the Listener (F11)
----------------------------------------------------------------------
ClearListener()
pos = [0, 0, 0]
pos[{3}] = {0} * {6} - Screen Space Horizontal
pos[{4}] = {1} * {7} - Screen Space Vertical
pos[{5}] = {2} * {8} - Screen Space Depth
print pos
Share this Doc

Command Editor

Or copy link

CONTENTS
Shopping Cart
×