As of FBX version 7500, the element metadata values are 64-bit as
opposed to being 32-bit in earlier versions.
FBX exported by Blender are currently always FBX version 7400, so the
FBX binary writing code was only set up to handle writing version 7400
files and earlier.
The json2fbx.py script however, can create FBX files with whatever
version is defined in the .json. Because the script uses the same code
as exporting an FBX with Blender, it would create invalid FBX version
7500+ files with 32-bit metadata values. Attempting to read one of these
files with Blender or external software would cause errors.
This patch sets global variables based on the version of the file being
exported and then uses those global variables when exporting to export
with the correct metadata values for the file version being exported.
This process is very similar to what is already done in parse_fbx.py
when importing FBX files.
There are no expected changes to FBX files exported by Blender with this
patch, only the json2fbx.py script should be affected.
Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104913
Blender has been interpreting the FBX 'C' type as bool, however, it is
actually an 8-bit integer that is separate from the already existing
byte/int8 type. FBX does have 'B' as a bool type, but it seems to be
unused.
FBX Converter displays what it calls "byte" ('Z' type) numerically,
but displays what it calls "int8" ('C' type) with both the numeric value
and the ascii character for that value, which leads me to believe that
this 'C' type should be interpreted as a single `char`. While there
doesn't appear to be many places that the 'C' type is used, it appears
to usually be set to a printable character.
Python doesn't have a `char` type, so the single `char` is read and
written as `bytes` with length equal to 1.
There are no expected changes to the import or export of FBX files with
this patch because the only FBX element that was incorrectly being
exported as a bool is now exported as the '\x01' char, which has the
same raw value as the `True` value that was being exported before.
The main benefit to this patch is that FBX files converted to .json with
fbx2json.py (and optionally back to .fbx with json2fbx.py) will now
maintain any 'C' type values instead of reducing them to True or False.
Additionally, should FBX files using the 'B' bool type be encountered in
the future, they are now supported.
Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104914
Added support for some pbone custom properties saving to metarig.
Custom properties widely used as a way to tweak rigs with drivers,
so an option to save them to metarig will definitely help.
Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104695
Fixed box deform operator following "context.temp_override" API changes in Blender 4.0
Changed:
- If box deform operator is launched through customized shortcut, same shortcut will be used to cancel (Previously cancel was hardcoded to `Ctrl + T`)
- Some operators idname were adjusted to expose "Assign Shortcut" from UI context menu
The old math wasn't handling inverted quaternions. In comparison,
Matrix.lerp is actually using internally exactly the same math code
that is used by constraint influence.
- Cache the main feature set URL and its error status in the entries.
- Set the error flag if loading the feature set throws an exception.
- Show an error icon and highlight in the list when necessary.
- Allow a feature set to declare that it depends on another feature set,
using its 'link' as the unique stable identifier.
- Add ghost entries for feature sets mentioned in the manual at the
end of the list, even if they are not actually installed.
This rig type implements a tentacle with an IK system using the Spline
IK constraint. The controls define control points of a Bezier curve,
and the bone chain follows the curve.
The curve control points are sorted into three groups: start, middle
and end. The middle controls are always visible and active, while the
other two types can be shown and hidden dynamically using properties;
when enabled they appear next to the corresponding permanent
start/end control and can be moved from there.
Enabling the Triangulate Faces option of the exporter or exporting mesh
Objects with Object-linked materials would remove the shape keys of the
exported Meshes, even without there being modifiers to apply.
This patch fixes the shape keys being removed, by using `Mesh.copy()`
instead of `BlendDataMeshes.new_from_object()` which currently always
removes shape keys and is unlikely to be changed to keep the shape keys
of non-evaluated meshes any time soon.
For the other cases of converting non-mesh Objects to meshes or
converting evaluated Objects to meshes when applying modifiers,
`BlendDataMeshes.new_from_object()` is still used.
The code has been reorganised to make the separate cases of using
`Mesh.copy()` and `BlendDataMeshes.new_from_object()` clearer than if
they were added directly into the existing code.
Aside from the lack of shape keys, it's possible there could be some
other differences between meshes copied with `Mesh.copy()` and
`BlendDataMeshes.new_from_object()`, but I have not noticed any.
Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104890
The exported type of the NodeAttribute for Empty Objects can be
controlled using a custom property called 'fbx_type' on the Object. This
feature was also being applied to Armature Objects because they use the
same function for exporting their NodeAttribute.
A check has now been added such that the exported type can only be
changed by the 'fbx_type' custom property when the Object is an Empty.
Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104887
The current intermediate data structure used to store baked animation
curve keyframes is a list of tuples where there is one tuple for each
frame and those tuples contain the frame time, a list of values and a
list of bools indicating which values on that frame should be written.
Represented through type hints it would be
`list[tuple[float, list[float], list[bool]]]`.
Constructing this data structure and writing it out to arrays that can
be written to an FBX file can take a surprisingly large amount of the
export time.
This patch splits the data structure into 3 separate arrays, an array of
frame times (now immediately converted to FBX time), an array of values
and an array of bools.
An immediate benefit to this is that every animation curve created by a
single `fbx_animations_do` call has the same frame times, so they can
share the same array of times.
The values for every frame are iterated into one large array in a fixed
order. Using this fixed order, NumPy is used to create views into that
array for the values of each animation curve.
By having entire arrays of values, NumPy can then be used to efficiently
convert from Blender values to FBX values, such as converting from
radians to degrees.
Writing out the final data is also much faster because NumPy can
efficiently combine the arrays of times, values and bools to produce
final arrays of times and values for each curve, which are immediately
ready to be written to the FBX file.
An export of a 1523 frame animation of a 65 bone armature animating 47
of the bones (almost entirely rotation animation) goes from a 4.1s
export to a 2.9s export for me with this patch.
An export of a 10000 frame animation of a shape key activating on a
default cube, with "Simplify" set to 0.0, "NLA Strips" disabled and "All
Actions" disabled, goes from a 0.79s export to a 0.56s export for me
with this patch.
There are no expected changes to the contents of exported files with
this patch.
Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104884
Allow including expressions that depend on the current values of bone
properties into the generated UI script for the panel. This can be used
for disabling buttons based on custom conditions, but the expressions
can be used anywhere arbitrary values are allowed.
In order to make the interface as clean as possible, this is implemented
via a class that wraps a string that is returned as its repr(), and
implements operators and methods for augmenting that expression string.
Some more complicated rig components require using helper objects,
e.g. a curve for spline IK. This commit adds a helper class that
manages creating these objects, reusing them between generations,
and removing them if not necessary. It includes management of
temporary objects that are needed during generation for whatever
reason, but should be removed after it completes.
* An option to generate a "Roll Forward On Toe" slider that makes the
heel roll control pivot on the tip of the toe rather than its base.
* A new IK to FK snap button that tries to snap IK to FK while using
the heel roll control to preserve the current IK control orientation
as much as possible. The operator allows selecting which roll channels
to use via redo panel.
The removal of the SVN repository and move to a simpler GIT one + usage
of weblate for actual translation efforts changes quite a lot of things.
Matches updates done to the i18n_utils py module in Blender sourcecode
itself.
This adds support for the basic update workflow.
Main TODOs:
* Investigate using weblate API to make admin tasks (repo updates)
easier and less risky.
* Make translating from Blender feature usable again (could also use
weblate API here actually).
Related to https://projects.blender.org/infrastructure/blender-projects-platform/issues/65
I've done a significant part of the work for the pose library add-on
(the asset & pose library system, the UI developed for/with the add-on
and the add-on itself) -- good for people to know that they can reach
out to me about this too.