How to prepare 3ds Max scene for exporting to All¹Mix format

From dgraphic
Jump to navigation Jump to search

AllMix is quite a powerful tool for creating, recording and broadcasting multimedia content in the field of television, broadcasting and education. However, this software product is focused primarily on medium and small companies, and even individual users. Those, the user of the AllMix program should not be required to have deep specialized knowledge that goes beyond his professional activities.

This means that 3D scenes must be prepared in a special way, allowing the average AllMix user (who does not have an idea about KeyFrame animation, materials, texture coordinates, etc.) to control the animation, assign media sources to scene elements, etc.

AllMix spends significant computer resources on processing incoming and outgoing video streams, media files, title elements, etc. This means that 3D scenes (several of them can be simultaneously used in one AllMix project) should be optimized so as to economize computer resources and ensure fast loading of 3D scenes.

The features of the preparation of 3D scenes for use in AllMix this article is devoted.

General information

The virtual studio built into AllMix does not use expensive and difficult to use tracking systems. However, in many cases it allows to achieve the same results. How is this achieved? In AllMix, the diffuse texture of the material of a special object in a 3D scene (a flat rectangle) is replaced with a “live” image of an actor (with an alpha channel) from a fixed real camera. When a virtual camera is moved, the observer sees a picture similar to that as if the real camera did not stand still, but moved in concert with the movement of the virtual camera.

This technology has both pros and cons:

  • The disadvantages include restrictions on the angle of view of the virtual camera relative to the "Actor" plane.
  • Advantages - the ability to animate a virtual camera in ways that are difficult to implement (or impossible at all) for a real camera.

In principle, the Render Engine AllMix allows, for example, to use real-time PBR (physically-based rendering) technology. However, in a 3D scene intended for use in AllMix, only standard materials and standard light sources are allowed. Moreover, with restrictions.

This is due to the following reasons:

  • firstly, the desire to maximize computer resources, speed up the loading of 3d scenes.
  • secondly, the real-time PBR picture quality is significantly worse than rendering quality in unreal time ("Vray", "Corona", "Arnold" etc.).

Therefore, creating a scene in 3ds Max using render engine “Vray”, “Corona”, “Arnold”, etc., followed by conversion through baking textures into a standard 3ds Max scene will make the scene “light”, and the picture when rendering real time in All¹Mix - high quality.

Thus, as a result, it is desirable to have two 3D scenes:

  • Initial (using render engine "Vray", "Corona", "Arnold", etc.), in which you can use any materials and any number of any light sources.
  • The resulting one, which is obtained from the original one by converting it into a “standard” 3ds max scene. It is from this scene that the export is made to an .fbx file for use in All¹Mix. For this scene use the standard "Skyline Render"

! When baking, use Map Channel 3

! All versions older than 3ds max 2020 convert all materials to “physical” when importing fbx files. To avoid this, you need to find the line StandardMtlFBXImport in the file C:\Users\ "YourUserName" \AppData\Local\Autodesk\3dsMax\ 202# - 64bit \ENU\3dsMax.ini and replace the value with StandardMtlFBXImport=1. After this, you can import the fbx file without losing standard materials.

! To be compatible with the AllMix unit system, set up the 3ds Max unit system as follows:

Units.jpg

3d scene optimization

Materials, light sources, camera

After baking the textures, all materials, light sources, cameras, etc. must be converted to standard for 3dsMax types:

  • camera - "FreeCamera"
  • light source - "Omni", "Spot", "Direct"
  • material - "Standard (Blinn)"

Currently, AllMix uses only three types of textures - "Diffuse", "Opacity" and "Reflection". Baked materials are best made self-luminous. This will remove the "extra" light sources, bringing their number to a minimum. Or even do without them.

The camera should be the only one. Different camera positions are set by an animation track. Values for clipping planes of the camera in the camera properties must be set manually (Clipping Planes / Clip Manually) in accordance with the parameters of this 3d scene.

To be compatible with the AllMix unit system, set up the 3ds Max unit system as follows:

!1 AllCast.jpg

Shadows

As recommended above, it is better to bake the illumination of scene objects into textures. However, these tips are not suitable for dynamic shadows (shadows from moving objects and the actor). In this case, it is recommended to combine baking scene lighting into textures and using the "Spot" light source.

3D Objects

It is undesirable to use groups (command Group). Especially for animated objects.

On the contrary, combining objects (command Attach) is always good both for saving resources and for fast loading. Of course, this must be done before baking the textures and taking into account the fact that the maximum size of the baked texture is 2048x2048 px.

Before exporting, it is recommended to apply the "Convert to Editable Mesh" and (then) "ResetX-Form" procedures to all objects in the scene. It will also significantly speed up the loading of the scene in AllMix and ensure its correctness.

Special names and properties of objects and materials in the 3d scene

3d scene objects available for editing in All¹Mix

  • The list of objects of the 3d scene, available for editing, adds objects with a name starting with the @ symbol. For example: @Table (also with a name containing the words "monitor", "video" or "actor" - for compatibility with previous versions).
  • Objects with a material name beginning with the @ symbol are added to the list. For example: @screen_material.
  • In the 3D editor All¹Mix it is possible to choose to display only one object out of several. To do this, their names must have a common part to the left of the @ symbol. For example: Table@wooden, Table@glass, : Table@metal, etc.

All¹Mix allows the user to change the position, orientation and scale of such objects, as well as to replace the diffuse maps of their materials with other image sources (images, video files, streaming video, etc.). In this case, the object must contain only one material.

  • If the object's material contains a transparency map, then it will be possible to assign media with an alpha channel to this object (in particular, the "ChromaKey" technique can be applied).
  • If the first character in the material name is an exclamation point (for example "!MaterialName" "!@MaterialName " ), then the texture coordinates of the object in AllMix will be assigned in each frame in the "overlay" mode (similar to the "Camera Map" modifier in 3ds Max) .


Media object "Actor"

3D object "Actor" must be a planar object (rectangle) with aspect ratio 16: 9 (HD) or 4: 3 (SD), depending on the type of camera filming the real actor.

If the first character in the name of this object is an exclamation mark (for example "! MyActor"), then the object will always "look" at the virtual camera. Starting from version 2.0.076, the axis of rotation is determined by the AllCast program by the orientation of the Gizmo of the planar texture coordinates (the "top" of the Gizmo must coincide in orientation with the "top" of the scene). The exclamation mark will also work in earlier versions of AllCast if "Actor" is created in the following way:

  • Create a Plane object in the Front window.
  • Apply the "Reset XForm" procedure to it
  • Apply to it the procedure "Convert To Editabel Mesh"

There is a technique that allows a virtual camera to "zoom in" to the waist plan of a full-length figure without losing the quality of the "Actor" image. To do this, the real video camera filming the actor is rotated 90 degrees. As a result, the image from the camera will also be rotated, and we have to compensate for this rotation in the 3d scene.

If there is no exclamation mark in the name of the "Actor" object, then simply rotate the rectangle 90 degrees. If "!" is present, we must also assign texture coordinates so that the "top" of the Gizmo coincides in orientation with the "top" of the scene. Then fix the picture by turning it in the material editor.


!2 AllCast.jpg

Reflections

Real-time reflections

AllCast has the ability to render real-time reflection for planar objects. Such objects should also not contain more than one unique material.

A planar object can be of any shape, and even consist of separate exploded fragments. The main thing is that all the elements of the object lie in the same plane. The "pivot" of the object must also be in this plane. As a rule, the objects for assigning reflection are the floor, table surface, etc.

In order for AllCast to perceive the object as reflecting, it is necessary to set the "checkbox" for the "Reflection" option in the material assigned to it and set the "weight" of the reflection.

The "map" field must contain a "FlatMirror" procedural map. The amount of reflection blur is set by the "Bloor" parameter in the "FlatMirror" map properties.


!3 AllCast.jpg

Non-dynamic reflections

For scene objects, it is possible to set static reflections using texture maps of the Reflect / Refract type in the material editor.

Reflect refract2.jpg

Simulated reflections

Simulated reflections are set in the usual way - through a single texture map:

Reflect refract3.jpg

Animation

The principle of building animation in AllMix

In AllMix, playback of animation tracks (created in 3ds Max) is performed between some named object "States", with unique sets of parameters: "position", "rotate", "scale".

The principle of "State" animation is that when working in AllMix, the user selects not a specific segment of the animation track to play, but “destination” - the "State" to which the object must “come”. At the same time, the AllMix program automatically selects the segment of the track, the beginning of which corresponds to the current state, and the end - to the target state. If there is no such segment of the track, then the transition from the current "State" to the final "State" is instantaneous.

Why does AllMix use “State Animation” technology to control animation instead of seemingly more understandable “Action Animation” technology? ("Action Animation" is such a control method, when each segment of the object's animation has its own button, which is responsible for starting the animation for a given segment of the track).

For example, consider a 3D scene in which there are N basic positions of a virtual camera and in 3ds Max segments of animated tracks are created that correspond to all possible “moves” of a virtual camera between these basic positions. According to the combinatorial formula, the number of such segments (and, consequently, the number of corresponding buttons for "Action Animation" technology) should be N! / (N-2)!

That is, for a scene with three, six or ten basic positions of the virtual camera, we will need, respectively, 6, 30 or 90 buttons for "Action Animation" technology. But to control the animation according to the “State Animation” technology, we will need only 3, 6 or 10 buttons, respectively. The difference is significant.

In addition, "State Animation" technology greatly simplifies the work of the operator. He does not need to think about the basic position of the virtual camera at the moment. Simply select the button corresponding to the desired next camera position.

Creating a "State" - animation in 3DS Max

To avoid mistakes and confusion, we recommend starting with the following:

  • First of all, the time configuration of the animation should be converted to the “Frames” format (Time Configuration / Time Display / Frames), since for AllMix the description of the lengths of the animation tracks is set in this format.
  • Then, in the "Auto Key" mode, after some (small) intervals on the frame track, we create the base keys for the virtual camera or/and 3d scene objects. The keys must contain values for "position", "rotate", "scale" (for the camera - only "position" and "rotate"). To make sure that the keys contain all the necessary parameters, you can apply the "Create Key" option to each created base position on the personnel track.
  • Each basic virtual camera or/and 3d scene objects position, rotate scale (i.e., “State” with a unique set of parameters “position” and “rotate”) will come up with unique and “speaking” names (for example, we have four “States” and we will call them “Near”, "Center", "Left", "Right") and for now keep them in mind. They will come in handy later.

Creating animated transitions and their description

We will need the created keys as samples when creating segments of animated transitions between the basic positions of (for example) the virtual camera. We will copy them to the beginning and end of the segments of the track that define the animation of transitions between a pair of "Stats". This will guarantee that the values of the keys will be the same for the same "State", no matter what position of the track it is.

!By the way, it is useful for our "exemplary" keys to set properties immediately (for example: Easy From = 25, Easy To = 25, Continuty = 0).

The next step is to create segments of the object animation. The segments themselves can be of any length and contain any internal keys. However, as we have already indicated, they must begin and end with keys copied from "exemplary" "Stats".

We need to tell the AllMix program which segments of the animation to use for transitions between "States".

The description of the used segments of animated tracks, the corresponding transitions between the steits of each animated object is set in the user properties of the same object in the following format:

<animation name="<StateName>_to_<StateName>" from="<number>" to="<number>" />

Spaces inside quotation marks ("") are not allowed.

As a pair of <StateName>, we use the names for the states that were invented above, and as <number> we use the numbers of the first and last frames of the animation segments responsible for the animation of the transition between this pair of "States". As a result, we get the following:

!5 AllCast.jpg

In this example, the lengths of the animation segments are the same and have common edges, but this is not necessary at all. Transitions can be of any length. If it is more convenient to create segments of transition animation at some distance from each other, do as it is more convenient. Sections of the track that are not described in the user properties of the object will be simply ignored.

It is also seen from the example that it is not necessary to create and describe segments of animation corresponding to reverse transitions. Since AllMix can play tracks both in the forward and in the opposite direction.

If, after importing the scene into AllMix, "something went wrong", then first of all you need to look for the error in the description of transitions between the states in "Object Proporties / User Defined".

Parameter "loop"

If the value of the loop parameter = "true", then the described segment of the animation of the object will be looped. At the same time, this animation starts automatically after the scene is loaded into AllMix. By default (in the absence of the loop parameter) its value is set to "false". Therefore, for non-looped animation segments, this parameter can be omitted. On the contrary, for looped segments, you can omit the names of the steits.

For example, if there is a rotating earth globe in a scene that makes a complete revolution in 1000 frames, then in order to create its looped animation, we need to make the following entry in the user properties of the globe object:

!6 AllCast.jpg

Parameter "parent"

The parent parameter specifies the name of the node from which the animation is inherited.

<animation parent="NodeName">

- if the from/to parameters are specified, then the specified range of frames is played

- if the from/to parameters are not specified, then the range specified in the parent node is played

Parameter "children"

The "children" parameter is used when describing the animation of the parent objects of the hierarchical tree of 3d objects of the scene. If the value of children = "true", then both the animation of the parent object itself and the animation of its "children" will play. In this case, the animation of the "children" in their user properties is not necessary. By default (in the absence of the children parameter) its value set to "true".

Children.jpg

Animation with hysteresis

Sometimes it is required that the transition from state "A" to state "B" and back is carried out on different animation tracks and/or for a different number of frames. In this case, you should create for such an object in 3DS Max two corresponding segments of the animation of the transitions between states "A" and "B". And in the user properties of this object, it is necessary to describe both of these transitions. For example:

<animation name="A_to_B" from="0" to="50" />

<animation name="B_to_A" from="60" to="75" />

Creating a Single State

To create a single state (for which there are no animated transition tracks to other states), the following properties of the "animation" tag should be used:

  • if the "from" parameter is not set, then it is taken equal to "to"
  • if the "to" parameter is not set, then it is taken is equal to from
  • if the parameters "from" and "to" are equal, then one state is formed, not two

That is, the following entries are equivalent:

<animation name="State Name" to="100" />

<animation name="State Name" from="100" />

<animation name="State Name" from="100" to="100" />

"Auto State"

What will happen if the animation of the object is created according to the rules described above, but there is no description of transitions in the camera’s “Object Proporties / User Defined”?

In this case, after loading the scene, AllMix will try to determine the “States” by itself, create a description of the transitions and the corresponding control icon buttons. For simple animation, quite often the automaton guesses "what the author meant." Especially if the segments of the tracks responsible for transitions between "States" have common edges. Otherwise, it is possible to automatically create unnecessary transitions, and in some cases, the loss of some " States". Something can be fixed in the built-in AllMix editor, but something is not.

Therefore, it is better not to be lazy and describe transitions between the " States" in "Object Proporties / User Defined".

Some useful additional information

For the creator of the 3D scene, it is useful to know how AllMix uses the contents of the custom properties of the object:

  • After loading the scene, the program automatically creates icon buttons in the interface that correspond to the "States" that have custom properties, designed according to the above rules.
  • When you click on the icon of any "State", the program finds a line from the list in the user properties of this object, which contains a couple of "States" (current state and destination state) and plays a section of the track that is specified in this line in one direction or another.
  • The images on the icon are generated as a "snapshot" from the virtual camera corresponding to the result of performing the action by clicking on this button-icon.
  • In addition, the icon displays the name of the "State" to which this icon corresponds. That is why it is desirable that the name of the state corresponds to the purpose of the button.
  • If only one transition is described in the properties of some "Object Proporties/User Defined" object, then when importing a file (containing this description) into All¹Mix FBX, only one control button-icon will be generated. When you click on this button, the animation segment will play in the specified direction, and when you click it again, it will play in the opposite direction.

Export from 3ds Max

To use the 3D scene in AllMix, you must export the scene in FBX format:

Export.jpg