Product Setup in Blender To Utilize Mimeeq Scripts
Introduction
The following documentation specifically relates to using Mimeeq's Custom Scripts for processing files authored in Blender.
The scripts optimise many steps making the setup for the 3D Artist much easier, such things as:
Auto creation of 2nd UV Map and creation of Ambient Occlusion maps
Bake and postprocess of the AO and shadow maps as image files
Compression of the file with Draco compression
Generation of the a second, automatically decimated, lighter version of the model that serves AR purposes
Creation of the CSV that automatically maps the object with the corresponding AO/opacity texture in Mimeeq app.
This entire process is automated, provided the initial blend file is set up correctly as described below.
Blender Structure
Output files
The process revolves around the use of collections, with each collection producing several types of files:
A compressed GLB file featuring the compressed model associated with the collection.
A low-poly version of the model, automatically simplified for efficiency.
An Ambient Occlusion (AO) map - except the "temp" case (see "Additional Options" section).
An opacity map, applicable when any model in the collection includes SHADOW in name (see "Additional Options" section).
A CSV file that facilitates the direct linking of these maps to their corresponding objects within the Mimeeq app.
All the file names are created based on the file name and the collection name.
💡 See the example of the output file below:
Collections
Models are categorized into distinct collections based on certain criteria:
The visibility aspect of the object:
For instance, a chair model without armrests would belong to one collection, while models for the first and second armrest options would be placed in separate collections. This organization strategy ensures that only the relevant GLB files, corresponding to the selected parameters in the option panel are loaded by the browser in the Mimeeq configurator.
The anticipated impact on the quality of the AO map:
The presence of numerous elements within a single map can affect its quality. There is no strict guideline regarding the number of objects or polygons that can ensure the good quality of the shadow; rather, it relies on intuitive judgment. For example, a chair mentioned above with multiple components such as a mechanism, seat, backrest, and base might necessitate separation into different collections to maintain optimal AO map quality.
💡 An example of the properly done structure:
Before submitting files for processing, ensure each collection is visible, enabled for rendering, and included in the view layer. All objects must be organized within collections, and there should be at least one collection nested within the main Scene Collection.
Model Requirements
For optimal results, we recommend using a model designed with an even, optimized quad-base topology. It is not a necessity, but a very good practice. While there is no strict limit on polygon count, achieving a balance between a lightweight model and realistic quality demands both intuition and skilled modeling.
Few requirements and suggestions:
Ensure the model is segmented into objects based on variations in materials and visibility options (which may be toggled on or off).
Apply all transformations and verify the direction of normals to confirm the accuracy of both the model's scale and orientation.
Make sure the model is centered and oriented to face the camera directly.
There is no need to flatten the modificators - script does it.
Note that textures don't have to be applied, as the script will remove them anyway; textures will be added independently within the Mimeeq app.
We also recommend inspecting the model at close range to ensure it has adequate subdivision to avoid unsightly curvature, and that proper smoothing is applied.
💡 Example of the recommended model topology:
Unwrapping
Every object in the scene must be unwrapped, even if it is automatic unwrapping. Should there be any alterations to the model's structure, it's advisable to unwrap it again to prevent any texture stretching.
For those aiming to incorporate materials from the Mimeeq library, it's necessary to adjust the global scale of the UVs. This adjustment can be made using the Magic UV plugin for Blender. Installation guidelines for Magic UV can be found here. After unwrapping your object, the next step is to set the World Scale UV to a density value of 3200 (see below):
To ensure the UV map is properly distributed, using a UV grid material for verification is recommended. Given that the majority of textures in the Mimeeq library are designed with horizontal patterns, it may be required to rotate the UV map accordingly for optimal use of these textures.
Additional Options
Here are some further steps you can take to enhance the quality and optimization to an even greater extent:
"Shadow" Command
Incorporating the term shadow into the name of the object will create an opacity map for the collection that includes this model. It's especially advisable to apply it to the plane beneath the model to attain the effect of a shadow underneath
💡 See the example below:
"REMOVE" Command
We employ the REMOVE command to enhance the quality of shadows between collections. To have a specific mesh cast a shadow within the collection without being exported, simply make a copy of it, relocate it to the desired collection, and append "REMOVE" to its name.
💡 See the example below:
To optimize the quality of the Ambient Occlusion maps, we divided the model into several collections.
The highlighted objects with the "REMOVE" tag are essentially duplicates of the objects without the "REMOVE" tag. They are serving solely for shadow projection onto the object without the "REMOVE" tag within the same collection. They are not included in the final export. If the same "REMOVE" object is applicable across multiple groups, it's efficient to interlink it among them.
Utilizing the "REMOVE" duplicates is beneficial especially when they directly surround the object slated for export. Additionally, employing a "REMOVE" shadow plane is advisable to simulate the shadow effect from the ground on the object, enhancing realism.
Temp Collection
If a collection's name contains the word temp, it will not produce an ambient occlusion map. We suggest assigning elements such as engravings and logo placeholders, stickers, tags, items with glass or mesh material, and stitching geometry to these collections. They do not need the unnecessary map.
Custom Lights
Our default scripts do not accommodate the inclusion of light sources from Blender during the baking process. While it is feasible to bake Ambient Occlusion using Blender's lighting with another script of ours, this method frequently necessitates numerous adjustments, as achieving satisfactory results typically relies on a trial-and-error strategy. Please contact us if you want to apply this solution.
Instances
The Mimeeq app is designed to work with instances, making it advantageous to utilize them for repetitive elements in your model for optimization. To prepare your instances for the script effectively, follow these steps:
Include the word "Instances" in the name of the collection.
Create a source mesh and label it with "INSTSRC" in its name.
Use the ALT+D shortcut to generate instances from the source object.
Ensure that modifiers are applied ('flattened') on the instances before creating them, rather than left active.
Maintain all instances within the same collection as their source mesh. If there are numerous instances, organize them into sub collections within the main collection to maintain file organization.
Instances can be moved, rotated, and scaled, but their individual geometries must not be altered.
💡 The example of the properly set up instances:
The INSTSRC object can be a visible component of the model or it can be positioned off to the side for logical reasons. The app allows it to hide it through specific rules, which is useful, for example, when varying instances of the same item (like a desk leg) need to be shown or hidden depending on another aspect of the model, such as the desk size. In this case, it is easier to control the instance source when it is not a part of the model itself but set aside (see screenshot above).
Final Words
It's not uncommon to need multiple iterations to correct errors, especially in complex projects with numerous meshes and collections. The process typically involves preparing the files, running the scripts, identifying any issues, and then rerunning the scripts until the desired quality is achieved. This iterative approach is standard in the workflow. Please contact us in case of any edge case not covered by this documentation.
Updated on: 18/04/2024
Thank you!