afcstudio / bcryexporter Goto Github PK
View Code? Open in Web Editor NEWBCry Asset Exporter from Blender to CryEngine
BCry Asset Exporter from Blender to CryEngine
If your skeleton animation project have skin or chr nodes, then rc.py file tries recompile (second compile) for skin and chr nodes, even if you want to export animations, finally rc.exe generates errors for unfounded skin and chr files.
That is unwanted situation. if user use Export Animation tool rc.py skip recompile (second compile) stage, even if there are skin or chr nodes.
To do that we can add is_animation configuration variable both for Export and ExportAnimations class.
Add Export Node tool must be improved.
A few UDP fix.
I tried to export one animated mesh as CGA with mesh for collider, but without any success.
Is it supported proxy for CGA for now?
Also I found what only one mesh can be exported per file.
It means for example: to make animated sci-fi doors with three parts, you have to create three *.cga file with three *.anm file (
I guess this is not limitation of CGA file because in Maya they may have complex meshes with using separate colliders for parts (see last pics) https://www.cryengine.com/community/viewtopic.php?f=315&t=133020
Geometry exporting must be completely adapt to BMesh.
Regulations of UDP:
Uploaded Player_SDK.blend file is old which has problems.
We must reupload PlayerSDK.blend
Base for Custom Icons.
Library controller improvement for skin and chr nodes.
Cryblend could not export to bone axis orientations for skeletons. Instead, it export all bones as global world locations without any rotation. So rotation informations were (0, 0, 0).
We must export bone orientations with their orientated locations.
Blender pose bone matrices:
Blender pose bone matrices store bone rotations and global locations. We must export to DAE (to RC.exe) the locations as orientated locations. Therefore, firstly, we must create a transformation matrix to convert world locations to orientated locations. Then we can combine rotation and new orientated location in a new matrix. Finally we can export that new matrix.
CryEngine Player SDK has X-Axis bone orientation as primary:
To use CryEngine SDK animations we must work with X-Axis bone orientation. Unfortunately, Blender only works with Y-Axis bone orientations. To solve that problem, we can again create a transformation matrix to change bone orientations to X-Axis from Y-Axis at export time. When we do that type axis changing, as well we have to change a axis to a negative own its. I am going to use Z-Axis for that. So, in Blender Z-Axis changes to -Z-Axis for DAE.
Combine two matrices:
We can break down that two problem in one stage with one transformation matrix.
Animations:
That rules valid for CHR and SKIN files, so what about animations? Axis changing (Y to X) requires a bit more working for animations.
BCRY Export empty object as dummy object at bcry export nodes.
PS: Fixes #111
If mesh has zero area face, smooth normals area calculation #46 generate a ZeroDivisionError at get_normal_array function.
Note: Tessfaces have no connection with bmesh, so tessfaces can not be used with bmeshes for now.
Therefore we must use triangulated geometry for normals and uvs, which in that situation normal and uv array extended. We should track of bmesh tessface support in the future version of Blender.
PS: BMesh have tessfaces and now it's usable.
Armature writing needs a few improvements to enhance exporting capability for have SKIN and CHR nodes project.
Improve apply transformations tool.
Find weightless tool must be improved.
There is no any Weightless Vertex:
Blender Layer support.
As default, Blender doesn't have alpha channel for vertex colors which used blend layers at CryEngine.
We can add a vertex color channel named Alpha for that.
Now, Vertex normals calculated weighted of shared faces. Face areas do not considered. We must consider face areas to calculate vertex normals.
Player SDK v0.7 include exact character positions and orientations.
Currently default physical proxy type is default. That sometimes generate high polygon physic problem for meshes those high polygon count when use auto materials. To solve that default material type can be changed to none.
Support of Custom Normals for shading.
Custom Normals
How to Use Custom Normals
Custom Normals on Blender:
Blender Custom Normals
New smoothing system
What you see in Cryblend what you get in CryEngine for shading
With that issue, one do not need anymore apply Edge Split modifier before exporting objects.
What your object shading is in Blender, you get object shading is in CryEngine in all circumstances.
Add Primitive Mesh tool add material to created mesh with name convention.
Create a new tool named as Generate LODs to create LODs just with one click.
Tool settings:
View Offset: Distance between LODs object. Just related showing in scene. Don't influences exporting.
Also LOD exporting behavior must be rearranged.
LOD Name Convention:
Player SDK version 0.4
Create a material_utils.py file and collect all material function into that file. That is also a base of Generate Material tool.
New Generate Materials feature use directly xml writing to generate mtl files.
If blender material has no a diffuse texture (intended to use directly colors), Generate Material tool has to assign default white texture for diffuse.
Default White Texture path: textures/defaults/white.dds
Note: If material is physProxyNoDraw then diffuse texture have to be empty.
Bone Geometry Orientations:
Now, bones have rotations so we can add as well rotations to bone physical proxies. That also has advantage to edit bone geometries in Blender.
Axis Transformations:
Bone axis are changed at exporting time (Y-Axis to X-Axis), we have to consider that transformations also for bone geometries.
Inverse Kinematic Properties:
We have to change IK properties (min, max, damping, spring, spring tensions) according to bone axis conversion.
Bone Geometries to Primitives:
To make bone geometries to primitive like capsule and sphere, we have to scale a bit (1.07 each axis) bottom face of mesh. Even after did that, needs to edit for some geometries.
Improvements
Create skeleton physics with just one click.
Physic Skeleton: Use to generate physic skeleton with ends with __Phys.
Physic Proxies: Use to generate physic bone geometries.
Physic Proxy Settings: Writes physic information to bone. (capsule, cylinder, box ...)
IK Settings: Writes default inverse kinematics information to bone.
Physic Proxy Sizes: Use to set radius of proxy bones.
Create Physic Materials: Adds materials to proxy geometries.
Use Single Material: Use to create single material for all proxy geometries.
Add VCloth V2 exporting support to BCry Exporter.
Note: VCloth skin must be exported alone. One can use Export Only Selected Nodes Tool at General Export Panel.
We should use Tessfaces to write mesh triangles.
BCRY should exports child object with relations, if child object is in same node with parent.
If child object is not in a node then it's should be overlooked.
Sometimes users can be forget a text at Blender ExportHelper, in that case Select Game Directory tool raises NoGameDirectory error. To solve that we must remove forgotten text, if it is not a directory.
Also when the directory is invalid we must raise a meaningful exception instead of NoGameDirectory.
Animation Matrices:
Different from character files (CHR), animation matrices are stored as locals for CryEngine in DAE. To do that we can use parent bone inverted matrix.
Final_Bone_Matrix = Bone_Parent_Matrix * Bone_Matrix
Y-Axis to X-Axis:
Also we must consider changing axis orientations for CryEngine Player SDK.
Final_Bone_Matrix = Bone_Converted_Parent_Matrix * Bone_Converted_Matrix
Custom Normals exporting process have to be calculated according to face area weights.
BCRY Exporter Vehicle Exporting Support
Improved Add Root Bone Tool.
Forward Direction: The root bone faced direction.
Bone Length: The root bone length to represented in 3D view.
Name: The root bone name.
Hips Bone: Hips/pelvis bone name that must be top parent bone.
That tool add a locator locomotion bone to selected armature according to CryEngine requirements.
Forward Direction: The Locator Locomotion bone faced direction.
Bone Length: The Locator Locomotion bone length to represented in 3D view.
Skeleton Root Bone: The Locator Locomotion bone is going to be linked/parented to that bone. Default value is top parent bone.
Movement Reference Bone: The Locator Locomotion use that bone to copy movements from selected axis. Default value is child of top parent bone.
We should improve smooth shading behavior.
Derivation of BCryExporter from Cryblend.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.