Skip navigation

Category Archives: Flash/3dsMax

Those tools are ready to use but not yet implemented. They are completly working but we are waiting to implement them in good condition maybe on coming productions.

All those tools are based on action script class file (.as) that mean they are using same code it’s faster and can help you to make improvement on all tools in same time.

Slider:

This slider is fully working with morphers (or anything else need to use slider) you have spinner and slider integrate in same tool, the percent number is can be modified by user directly with keyboard. This slider is based on specific class that mean all slider you can create are running from same peace of code it’s really faster than usual sliders in 3dsMax.

Flash based Slider

Flash based Slider

Blend Shape tool:

This tools is completely awesome and faster than everything i created before. If you are looking in dotnet tool you can quickly see many problems while using them, slower performances, graphical issue with with the cursor.

Flash based square blend shape

Flash based square blend shape.

Publicités

Here is a sample of what i made with this UI system.

This UI can automatically detect characters in scene without any datas saved. They are detecting the character’s .bip.

All those settings and parameters are working around 3dsmax’s biped.

All common tools need to work quickly in expert mode (full screen viewport)
You can find TCB tool with XML presets local for each users.
Biped’s copy past tool. Specific scale tool.
Hand position preset with copy past include.
All layers and Named selection set of the current character.
Quick smooth enable disable for the current character, hide unhide bones, hide unhide facial, freeze unfreeze modeling, hide unhide modeling.
The most visible is the synoptic to chose quickly your bones without them visible, this synoptic include shift+click to add more bones, right click to select symmetrical / opposite / select all spine, double click to select all childrens.

the first UI's tab (the common one)

The first UI's tab (the common one)

The most interesting part is the facials preset’s tab based on database with xml saved for every characters, with thumbnail pictures in two sized. When clicking on the thumbnails the expression is apply on the characters with all settings include: morphers, eye’s target positions, pupil’s scale value and more…

Facial presets UI's tab

Facial presets UI's tab

All those screen print are taken from my incoming Demo Reel.

We know how to send a simple call from flash to 3dsMax now we wanna know how to receive and this call inside 3dsMax.
This is not the best way to do that but a good example to have a quick understand of how it works.

First we have to put inside the rollout that host the .swf an listener for all fscommand it’s exactly like the Click

Eventlistener inside Flash viewed in part 3.

on flashhosteur FSCommand cmd args do
(
flash_FSCommand cmd args
)–End Of flashhosteur FsCommand

This command call a function used to filter all fscommand and find the good function to call using a case of.

fn flash_FSCommand cmd args =
(
–format « flash_FSCommand -> % %\n » cmd args
case cmd of
(
« AnimateToggle »:
AnimateToggle args
)
)

Here the case of will read the command argument receive from the fscommand if this cmd correspond to one of the cases it will

read the line just after in our case call another function inside our script.

The fonction called is :

fn AnimateToggle args =
(
if (args == « true ») then
(
animButtonState = true
)
else
(
animButtonState = false
)
)

This function examine the arg value sent by the fscommand.
In simple english this function is doing this:

If fscommand called AnimeToggle, the fscommand send to this function an argument, if this argument is equal to true then turn the animate mode to on else turn it to false.

To toggle animate mode we can simply in the case of:

« AnimateToggle »:
max tool animmode

But the goal is to show you how to use function to call inside an fscommand call. This will be very usefull when making more complicated things.

Here is the final .ms code at this step:

try(destroyDialog flash3dsMax_Explain)catch()  –if opened
try(destroyDialog flash3dsMax_Explain)catch()

fn AnimateToggle args =
(
if (args == « true ») then
(
animButtonState = true
)
else
(
animButtonState = false
)
)

fn flash_FSCommand cmd args =
(
–format « flash_FSCommand -> % %\n » cmd args
case cmd of
(
« AnimateToggle »:
AnimateToggle args
)
)

rollout flash3dsMax_Explain « Flash / 3dsMax Explain »
(
activeXControl flashhosteur « {D27CDB6E-AE6D-11cf-96B8-444553540000} » pos:[0,0] width:500 height:500 releaseOnClose:true

local SwfFile = « C:\\Users\\eddy\\Desktop\\flash3dsMax_explain\\flash_explain_03.swf »

on flash3dsMax_Explain open do
(
try
(
— initialise activeX object
flashhosteur.movie = SwfFile
)
catch
(
— retry
flashhosteur.movie = SwfFile
)
)

on flashhosteur FSCommand cmd args do
(
flash_FSCommand cmd args
)–End Of flashhosteur FsCommand

)
createDialog flash3dsMax_Explain « Shockwave Flash Input Test » width:500 height:500

Actually our Flash UI is plugged directly in 3dsMax but we do not have any interaction between 3dsMax ans Flash.

In this part we will learn how to send calls from Flash to 3dsMax.

It’s pretty simple to send basics informations using « fscommand ».

In our case i want to click on the animate Button of my Flash UI to Activate Animate mode in 3dsMax.

First we have take a look inside our fla. I added a Listener for the animate button to create an Click Event.

animate_sphere_clip.stop();

var buttonAnimateStatue:Boolean = false;

Animate_toggle_bt.addEventListener( MouseEvent.CLICK, AnimateToggle);

function AnimateToggle(pEvt:MouseEvent ):void
{
if (buttonAnimateStatue == false)
{
animate_sphere_clip.gotoAndStop(2);
buttonAnimateStatue = true;
}
else
{
animate_sphere_clip.gotoAndStop(1);
buttonAnimateStatue = false;
}
}

This line says to stop the playing the swf timeline on opening. The .swf stopped to the first frame. Why Make a stop? I have to do that because inside my Flash UI i added to statues to my button one Green and one Red. First Statue for animate mode disable, second statue Statue for animate mode enable in 3dsMax.

Both statues of the animate button

Both statues of the animate button

var buttonAnimateStatue:Boolean = false;

This is a variable declaration used to know the statue of the button. If false the button is green (animate disable), if true the button is red (animate enable).

Animate_toggle_bt.addEventListener( MouseEvent.CLICK, AnimateToggle);

This is the line used to add the Event listener for the Mouse Click. Animate_toggle_bt. is the name of the animate AnimateToggle is the function that the Click Event will call.

function AnimateToggle(pEvt:MouseEvent ):void
{

}

Here is the function AnimateToggle declaration called by listener describe previously.
pEvt:MouseEvent mean this function is linked to a mouse event, in our case a simple click.

function AnimateToggle(pEvt:MouseEvent ):void
{
if (buttonAnimateStatue == false)
{
animate_sphere_clip.gotoAndStop(2);
buttonAnimateStatue = true;
}
else
{
animate_sphere_clip.gotoAndStop(1);
buttonAnimateStatue = false;
}
}

When the AnimateToggle is called we have to check if the animate mode is enable or disable inside flash that mean if the button is green or red because we do not already have feedback from 3dsMax. A simple if function can do that.

Here is the code translate in simple english with false = green and true = red:

On click If the button statue is green then turn the button to red and let the buttonAnimateStatue variable know the button is now red. Else the button is red turn the button to green and let the buttonAnimateStatue know the button is now green.

Now you know how the actual code is running inside flash. Let says to 3dsMax when to turn animate mode on On or off.

We are in flash we will stay in.
We have to add two lines inside our AnimateToggle toggle function. Those line are simple fscommand for the two cases of the if.

function AnimateToggle(pEvt:MouseEvent ):void
{
if (buttonAnimateStatue == false)
{
animate_sphere_clip.gotoAndStop(2);
buttonAnimateStatue = true;
fscommand(« AnimateToggle », « true »);
}
else
{
animate_sphere_clip.gotoAndStop(1);
buttonAnimateStatue = false;
fscommand(« AnimateToggle », « false »);
}
}

fscommand is to use like that: fscommand( CommandName, Argument);

Now we know why using flash in 3dsMax we can now learn how to do it.

This second part will explain how to simply load a swf file in a Max Rollout  using an ActivX Control you can find a good help about ActivX in Maxscript Help in « Shockwave Flash ActiveX Object Events » part. 3ds max have a good help so « Use It!! ».

To host your Flash you need to generate a swf file from flash like this one:

A pic that show my Swf file.

This Pic show you my swf file it's a simple button with two statues "green" and "red" to toggle the Animate Mode in Max.

You doesn’t need to generate a .html to host you .fla a simple .swf is enough.

To host my file i need to create a rollout with the same size as my .swf using this code:

try(destroyDialog flashTest)catch()  –if opened
try(destroyDialog flashTest)catch()

rollout flashTest « Flash Test »
(

activeXControl flashhosteur « {D27CDB6E-AE6D-11cf-96B8-444553540000} » pos:[0,0] width:500 height:500 releaseOnClose:true

local SwfFile = « C:\\Users\\eddy\\Desktop\\flash3dsMax_explain\\vert.swf »

on flashTest open do
(

try
(
— initialise activeX object
flashhosteur.movie = SwfFile
)
catch
(
— retry
flashhosteur.movie = SwfFile
)

)
)
createDialog flashTest « Shockwave Flash Input Test » width:500 height:500

All parts explain:

try(destroyDialog flashTest)catch()  –if opened
try(destroyDialog flashTest)catch()

This part is used to close the rollout if his already opened before you open it again.

activeXControl flashhosteur « {D27CDB6E-AE6D-11cf-96B8-444553540000} » pos:[0,0] width:500 height:500 releaseOnClose:true

local SwfFile = « C:\\Users\\eddy\\Desktop\\flash3dsMax_explain\\vert.swf »

This part is used to create the activX hoster for our swf and create a variable that contain the .swf fil that will be hosted.

DO NOT FORGET to add double « \ » for path names.

If you use an IP adress use this format with:

local SwfFile = « \\\192.168.0.14\\ptites_poules\\flash3dsMax_explain\\vert.swf »

With an IP adress use 3 « \ ».

on flashTest open do

(

try
(
— initialise activeX object
flashhosteur.movie = SwfFile
enableAccelerators = false
)
catch
(
— retry
flashhosteur.movie = SwfFile
)
)

This part is used to initialize the .swf file the rollout when when  opening. We have to done it twice because sometimes it doesn’t work the first time but it always work the second time.

« enableAccelerators = false » it necessary for swf file where you will have keyboard entry if it’s true all the keyboard entry you will make will done inside 3dsMax interface and not the activX.

)
createDialog flashTest « Shockwave Flash Input Test » width:500 height:500

Finaly this part is used to create the final rollout with our swf file accessible.

Here is the final rollout with our .swf file hoster.

This is my first concrete post and we will start with a big part how to connect flash with 3dsMax using simple action script.

-History:

I’ve started this integration based on Jo Plaete search in connection between Softimage XSI and Adobe Flash. I have done different interface in autodesk Softimage that i will show you later.

As a global TD at Blue Spirit Studio i was looking to make Animations UI for different series. The first One was for Kaeloo (series by Cube Creative and Blue Spirit Studio concept and direction by Rémi Chapotot). For this series we (Sebastien Albert and Me) made an interface in maxscript of which we were not completely satisfied by this one, we tried many techniques like DotNet, object based setup like joystick directly in scene. After all test it was clear flash UI was the good technology and during this search process i was looking at home how connect flash and 3dsMax and make it communicate in both direction and found solutions that i bring at Blue Spirit Studio. This technology is actually used on one series named « Les Petites Poules » adapted from the comics of Christian Jolibois, Christian Heinrich / Marine Locatelli, Patrick Régnard produced by Blue Spirit Studio directed by Jean-Luc François and will be used on coming series and movies with any improvements.

I will explain this concept by many steps and this post is the first one:

-Why an home made Animation UI?!

-All the characters in the company i’m working in are made around biped. If  you work with biped you have to use the motion tools for biped but this UI is very slow and poor that why using an different UI can be a big Plus.

– It’s a good tool for long production laps, like series where animators have to makes Seconds and seconds animation by day.

-Why using a flash UI in 3dsMax?!

-Easy UI creation: You can easily create your own look, design using vectorial components.

-Large community for Flash and ActionScript.

-Fast and powerful Language as ActionScript 3.0 that is an object oriented programming language allowing for more control and code re-usability when building complex Flash applications.

– Easy animated UI.

-Easy way to access to web’s 2.0 concept and most interesting access to Enteprise 2.0 (concept explain here). This concept is my goal because i really think CG company s are good places to apply this concept.

-Small flash tools can be integrate in a maxscript UI like DotNet tools.

-When working with flash and 3dsMax can be a problem:

-Actually there’s no flash player supporting 64bit that can be a problem in any cases.

-If you have text inside swf and have to edit it by default it’s impossible because 3dsMax accelerators are on and block other interactions i made a workaround for that too.

-I do not found how to pass directly more than one variable from 3dsMax to Flash and from Flash to 3dsMax but i found an workaround that i will explain later.

-It’s complicated to work on two software in same times but if you used to work with classes it can be easier using simple code editor like notepad ++ with class you can debug and change code in you UI directly in you code editor.