Combination of 2D foreground trigger and 3D trigger
Meishe special effects creation tool
1.0 version
Beijing Meishe Network Technology Co., Ltd.
table of Contents
2D foreground trigger and 3D trigger combination case... 3
2. Helmet trigger animation production... 3
Step 2: Start the Meishe unity environment... 3
The fourth step, the helmet trigger animation... 4
Step 6: Shading model settings... 7
Step 7: Material Attribute Setting... 8
The eighth step, export the scene package... 8
3. Foreground filter production... 9
Step 1: Add input source track... 9
The second step, caf material settings... 9
The third step, caf superposition mode setting... 10
Step 4: Select the album mode... 10
4. Foreground trigger production... 11
Step 1: Unzip to get the album compression package... 11
The second step, file copy... 11
The third step, delete the "uuid=" field... 12
Step 4: Add the effect2d tag... 12
Step 5: faceActionDetection field setting... 12
Step 6: Disable field setting... 13
Step 7: name field setting... 13
Step 9: Add related fields... 14
5. Generate arscene file... 14
The first step: Compressed folder processing... 14
Step 2: Modify the info.json file... 14
Step 4: Generate arscene file... 15
Combination of 2D foreground trigger and 3D trigger
Case description: The halo foreground, the user opens his mouth, and triggers the helmet model. The two effects are combined.
Use the arscene file preview in the material package.
1. Creative ideas
Use the unity tool to make an animation model of the helmet and trigger it according to the captured scene. Export the arscene folder.
Use Meishe special effects tools to make foreground effects:
- Extract the foreground script into the arscene folder;
- Modify the "arscene9v16.xml" script;
- Generate an arscene file.
2. Helmet trigger animation production
Step 1: Export FBX
Segment the animation in 3D software and export an FBX.
Step 2: Start the Meishe unity environment
Open unity, load the Meishe unity plug-in, and create a new trigger file
Step 3: Trigger folder
Import the divided 3D model material into the trigger folder in the project file and put it into the scene.
The fourth step, the helmet trigger animation
A. Animation description
An animation can have multiple trigger events, this example uses Action Increasing and Face Emerging events.
Create a helmet wearing effect, recognize the face and wear the helmet, and open the mouth to trigger the lifting and falling of the helmet mask.
The helmet model is made in 3D software, and the required animation clips a1, a2, a3 are made in the same model.
a1: the cartoon clip with the helmet on the head;
a2: The helmet mask raises the animation clip;
a3: The helmet visor falls off the animation clip.
Import the helmet model and adjust the initial parameters of the model as shown below:
B , Event1 settings
When the face appears, the helmet is automatically put on, and the animation clip a1 is applied;
Add the first trigger Event1, and set the Event Type to [Face Emerging] (face appears);
Add Trigger adds a trigger object, the trigger object settings are as follows:
C , Event2 settings
Apply animation a2 to open the mouth for the first time to raise the mask;
Apply animation a3 to open the mouth for the second time and let the mask down;
After that, the mouth keeps opening, and the animations a2 and a3 switch.
Add a second trigger Event2:
Add Trigger2 sets a2 and a3 as trigger objects, and the Index Period cycle period of both trigger objects is set to 2.
The Start Index of a2 is 0, and a2 will be executed first in a single loop.
The Start Index value of a3 is 1, and a3 will be executed second in a single loop.
The settings are as follows:
Step 5, add FBX
Add a mask FBX that simulates the head, place the mask FBX on the helmet, and change the mask transparency to 0.
Step 6: Shading model settings
Select the helmet FBX, and change the Shading Mode to [Standard Shading] mode
Step 7: Material attribute settings
Modify material properties.
The eighth step, export the scene package
Export the Scene Package.
3. Foreground filter production
Step 1: Add input source track
Select 9v16 frame, add [input source track], replace video for analog input source.
The second step, caf material settings
Import the caf foreground material and adjust the size and position.
Caf production reference: "CAF Introduction and Tool Manual".
The third step, caf overlay mode setting
Set as needed:
Superimposition method: screen (filter color);
Loop mode: repeat.
Step 4: Select the album mode
Select the album mode, name and export.
4. Foreground trigger production
Step 1: Unzip to get the album compressed package
The second step, file copy
Copy the foreground material and " fx9v16.xml " in the album folder to the 3D model folder exported by unity. The 3D model folder will be used in the future, and the album folder will no longer be used.
The third step is to delete the "uuid=" field
Open the " fx9v16.xml " file and delete the "uuid=" field
Step 4: Add the effect2d tag
A. Open the " arscene9v16.xml " file.
B. Add " <effect2D source="fx9v16.xml"/> " field.
Step 5: faceActionDetection field setting
In this case, a 3D animation is triggered, and the arscene9v16.xml file has a "faceActionDetection="true"" field.
If there is no 3D trigger, add this field manually.
This field indicates that the SDK reads the movement of the face. If this field is not added, the expression trigger cannot be recognized.
Step 6: Disable field setting
Write the "disable="1"" field to the 2D layer.
This field means: this layer is initially hidden and appears when it is triggered.
Step 7: name field setting
Write the "name=" field to the 2D layer.
Name the script that needs to be triggered. The name can be any name.
The source corresponds to the corresponding xml name. If the xml is renamed, such as triggering multiple scripts, the name also needs to be renamed here.
Step 8: add event layer
Add trigger event layer.
fxOn: trigger the script;
fxOff: Stop the script.
The effect of the example: it is triggered when the mouth of the 2D foreground layer is opened to 0.3 degree;
It disappears after running for 2200ms.
Reference for the writing and meaning of the event parameter:
A. "ARSence Production Specification Document 1.4.0 for the ARSence plug-in of Meishe unity";
B. Event trigger chapter;
C. Attachment "arscene-desc-sample-event.xml".
Step 9: Add related fields
Add the fields shown in the figure to info, and text prompts appear when the face stickers are used.
Pay attention to the field format, the comma cannot be omitted.
5. Generate arscene file
The first step: compressed folder processing
Compress the unity folder into a zip, and add the suffix ".1" to the compressed package name
note |
Add a suffix to the compressed package; Adding a suffix to the folder will cause the ARScene file to fail to read |
Step 2 : Modify the info.json file
To modify the ARScene effect, open the "info.json" file;
Each time you modify the version value +1, the suffix number of the compressed package is also +1.
Step 3: ID replacement
If you change the ID:
A. Double-click [UUIDFactory.exe];
B. Choose [Without braces];
C. Click [Generate] to generate a random ID;
D. Click [Copy] to copy this ID;
E. Replace uuid in the info file.
Step 4: Generate arscene file
Place the compressed package in the location: SDK conversion tool, the "arscene" folder under the PackageTools folder.
Double-click "arscene.bat" or "arscene.bat-shortcut" to generate an arscene file.