-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New dev branch #30
Merged
Merged
New dev branch #30
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This removes support for skinning.
…r an unexpected type
of the Blender camera, while the `aspectRatio`, if present, affects the resolution instead of the `angle_x` (since the latter is computed from the `angle_y` and the resolution in Blender)
...using just one cache-lookup function instead of one for every different type of object.
RGBA vertex colors are supported (required) by Blender 2.79 it appears.
Based on creating first a virtual forest that mirrors the scene graph we're about to create in Blender. Details to be documented later... if it works out :)
Skinning is now working (again (again))...
Messy and VERY slow for the moment, but functional so I'm commiting it for my own reference.
Comments explained the main reasoning behind the bone function. Also switching from keyframe_points.insert to the add/co loop gave a **huge** performance boost.
This is for faster slicing. This doesn't make any apparent impact on import times but hopefully it saves some memory ^^;
...because 4-component vertex colors are assumed. Should we use some shims to papers over the Blender version differences and get greater support? I don't have access to !=2.79 vresion atm though so it doesn't matter for now.
They don't point the right way or anything but they're there :)
But have an option to just put everything into the current scene too (I like that better).
This prevents loading the same one multiple times.
Using the groups from the exporter, thus relieving us form writing all our own node groups. The group for Specular Glossiness is also part of the serialized data, so supporting that is getting closer.
We add superfluous COLOR_0 layers to any mesh that uses a material that is ever applied to a primitive that has a COLOR_0 attribute. This let's us add an Attribute node to those materials without the problem of solid red colors coming in. COLOR_1, etc. are still not supported (well, they're imported of course, they just don't influence the materials).
- Avoid creating dummy vnodes for meshes when possible. - Rotate cameras to their (correct?) position - Some slightly tighter docs. - Some more robustness in realizing vnodes; it would probably be possible to use an armature for the whole forest again with minimal code changes
Animating non-bone locations should work now. Curve clean-up should be working too.
The vtree beneath an armature should now be all bones except possibly at the leaves, and we should realize them correctly(?) now. Also fix a typo with mesh names.
Avoids confusion with the similarly named node_groups stuff.
Support for pbrSpecularGlossiness was added here too.
Such as they are, anyway.
- Blender automatically replaced math.inf with HUGE, so I did it for it - Print a message about unknown camera types - Setting a value on a global scene cannot possibly be the right thing to do with the aspect ratio -- it has to go into a property of the camera. Otherwise there's a race condition where only the last camera to get created actually changes the scene. So I backed that out. - Normalized quotes.
...since it's still weird. Make the options prettier and ignore scenes by default too.
...by using multiple attributes sets. We anticipate here, since though there is a PR for this, it hasn't been merged into the spec yet.
If the accessor was used again later in the glTF, we would have seen a modified array since we hard-modified the accessor elements. Avoid doing this.
If the joints were eg. [0,0,0,0] and the weights were [1,0,0,0], previously we would overwrite the weight for 0 three times so it ended up as 0. Now it will correctly be 1.
We hardly have to do anything since Blender will already handle DDS textures so we might as well. Untested though.
Untested.
I initially thought the pose TRS was computed from (final TRS) * (rest TRS)^{-1} (ie. the opposite order of multiplication from what I now believe is correct.) Under this scheme, the pose components could depend on multiple final components, which required bringing the curves under a common domain. But under the correct order of multiplication each pose components depends only on its corresponding final component (and the rest TRS) so that turns out to have been over-complicated and, thank God, we can finally get rid of it! Though, alas! it does not fix Monster.
This ensures that COLOR_0 is always the first (and ensures Blender thinks its the default, for eg. TEXCOORD_0 and UV maps?) and avoids any gaps in the sequence of X.
- Pick better bone lengths (when the bones are rotated the armature actually looks plausible now) - Report a warning when bones had non-unit scalings in the glTF
Thanks! Great progress. Did not fully test everything but will look more closely before releasing 0.4.0. |
@ksons Thanks :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is my new dev branch, which is not perfect, but is a significant improvement on current master, IMO, so I'm PRing it. Main new features are skinning, experimental animation support, near-complete material support, and support for four new glTF extensions (one untested).
Hopefully I can get some feedback and testing. My internet connection is not currently up to the challenge of updating my sample model repo, so I have only tested it with an old revision of the samples ^^;;;
Coordinates
Meshes
TEXCOORD_0
. However, the color layersCOLOR_X
(X
>= 1), though they are imported, don't affect materials. (COLOR_0
does, see below.)Materials
COLOR_0
attributes affect the material. Fixes gltf 2.0 sample model BoxVertexColors doesn't import with vertex colors #23. The work-around for the issue I mentioned there was just to, whenever a material would have applied to both meshes with and without colors, add colors to the meshes without (this means some meshes may have aCOLOR_0
that didn't in the glTF file).Scene Graph
Bone lengths are still crazyShould be okay now.Animations
animation-name@object-name
. To play them, select the object, open the Dope Sheet, change to Action Editor, and select the desired action. (Is there a better way to import these?)Cameras