You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Application-specific attribute semantics MUST start with an underscore, e.g., _TEMPERATURE. Application-specific attribute semantics MUST NOT use unsigned int component type.
Name
Accessor Type(s)
POSITION
VEC3
NORMAL
VEC3
TANGENT
VEC4
TEXCOORD_n
VEC2
COLOR_n
VEC3 VEC4
JOINTS_n
VEC4
WEIGHTS_n
VEC4
_MY_CUSTOM_ATTRIB
SCALAR VEC2 VEC3 VEC4
These attributes can be exported by 3D modelling software where supported.
Blender, when "export attributes" is enabled, will export any attributes that begin with an underscore.
Names will be converted to upper-case to conform with the spec.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add a virtual method to GLTFDocumentExtension that can map these application-specific attributes to Mesh.ARRAY_CUSTOM#
Potentially other attributes could also be remapped. Currently, only COLOR_0 is supported, for example:
ifp_name=="COLOR_1": returnMesh.ARRAY_CUSTOM3
Blender will need to enable "export_attributes" when exporting to GTLF. This would require an extra checkbox, but alternatively be enabled by default as only attributes with underscores are exported, and unless the GLTFDocumentExtension method is implemented, would be ignored.
Because other attributes such as extra UV data may also be mapped to ARRAY_CUSTOM#, the importer should reject any ARRAY_CUSTOM# that already has data assigned and print a warning.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can't be realistically achieved with GLTFDocumentExtension without going to great lengths to re-implement much of the importer logic in GDScript.
Is there a reason why this should be core and not an add-on in the asset library?
GLTFDocumentExtension does not currently have the necessary hooks.
The text was updated successfully, but these errors were encountered:
I have various hair meshes in Blender and I'd like to use color vertex attributes to create an automated workflow that will determine which vertices are pinned and unpinned on a SoftBody3D in Godot using the meshes.
Example workflow:
Here in Blender I have a PinColor attribute. I painted black where I want the mesh pinned, white for unpinned.
On the Godot end, I will write an import script for my hair mesh that
Creates a SoftBody scene and adds the mesh
Loops through the vertices, grabs my PinColor attribute for that vert and sets the SoftBody pin for that vert accordingly
The end result is that I can simply export my GLB file of hair meshes from Blender, and Godot will automatically create SoftBody scenes for them with correct configuration of pinned/unpinned verts.
Another use-case: An attribute to hold a transform per instance in a scattered mesh system (in Blender) so that, in Godot, one can go through the mesh and with some work create a multimesh instead.
So, in Blender, I'd place store a name "_XFORM" on each instance of the repeated mesh, with the transform matrix as data. In Godot, in some import plugin, go through the surfaces in that mesh and seek that attribute etc.
Describe the project you are working on
This can apply to any project.
Describe the problem or limitation you are having in your project
There is not any way to import custom attributes from .gltf or .blend files. These are invaluable for use in shaders.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
GLTF supports Application Specific Attributes.
POSITION
NORMAL
TANGENT
TEXCOORD_n
COLOR_n
VEC4
JOINTS_n
WEIGHTS_n
_MY_CUSTOM_ATTRIB
VEC2
VEC3
VEC4
These attributes can be exported by 3D modelling software where supported.
Blender, when "export attributes" is enabled, will export any attributes that begin with an underscore.
Names will be converted to upper-case to conform with the spec.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add a virtual method to GLTFDocumentExtension that can map these application-specific attributes to Mesh.ARRAY_CUSTOM#
Potentially other attributes could also be remapped. Currently, only COLOR_0 is supported, for example:
Blender will need to enable "export_attributes" when exporting to GTLF. This would require an extra checkbox, but alternatively be enabled by default as only attributes with underscores are exported, and unless the GLTFDocumentExtension method is implemented, would be ignored.
Because other attributes such as extra UV data may also be mapped to ARRAY_CUSTOM#, the importer should reject any ARRAY_CUSTOM# that already has data assigned and print a warning.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can't be realistically achieved with GLTFDocumentExtension without going to great lengths to re-implement much of the importer logic in GDScript.
Is there a reason why this should be core and not an add-on in the asset library?
GLTFDocumentExtension does not currently have the necessary hooks.
The text was updated successfully, but these errors were encountered: