Commit Graph

8221 Commits

Author SHA1 Message Date
14a10cbb99 Fix Add Camera Rigs after 4.0 API changes
This pull request updates the 'add camera rigs' addon to use bone
collections for the 4.0 release.
It also adjusts some of the naming convention to match the Rigify.

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104919
2023-09-27 13:19:02 +02:00
7d2a5f2594 glTF: update shader after Principled changes 2023-09-27 08:56:02 +02:00
fef728a568 io_scene_3ds: Moved specular color texture to specular tint
Specular color now matches better to specular tint than to specular IOR level

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104918
2023-09-27 00:42:05 +02:00
f070019ded glTF: Avoid crash after Principled Specular changes 2023-09-26 22:18:32 +02:00
ce6775b50d Rigify: use the curved B-Bone mapping mode in upgrade face and metarigs.
- Support saving B-Bone properties of edit bones in the metarig.
- When upgrading legacy face use the curved mode for mouth corners.
2023-09-26 21:38:48 +03:00
11b929c893 io_scene_3ds: Update for Principled BSDF specularity
Exporting Principled BSDF specular tint as 3ds specular color
Importing specular color to Principled BSDF specular tint
Improved background image and hotspot export

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104917
2023-09-26 19:41:05 +02:00
e6ca87f4a6 Fix #104684: json2fbx.py script creates invalid FBX v7500+ files
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
2023-09-26 03:57:17 +02:00
d6ea3b5452 Fix FBX char type being interpreted as bool
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
2023-09-26 03:44:42 +02:00
d4f1a5d7e1 Import BrushSet: add filtering to only show folders and images
Filter for relevant files (Folders and Images) to show the user only
what is relevant for the Import BrushSet addon.

Co-authored-by: Daniel Grauer <dg>
Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104845
2023-09-25 22:06:27 +02:00
c9c0744ff7 Rigify: saving pbone custom properties to metarig
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
2023-09-25 21:52:56 +02:00
66be0382ed Shaders: update for Principled BSDF changes
Ref blender/blender#99447
2023-09-25 19:29:00 +02:00
332839d7ab glTF: implement EXT_texture_webp 2023-09-25 12:45:35 +02:00
bd7fea9ca3 glTF exporter: Manage UVMaps outside of materials 2023-09-25 12:34:22 +02:00
01b30876b1 glTF: implement EXT_mesh_gpu_instancing 2023-09-25 12:32:38 +02:00
e7a7626052 glTF: Better rigging roundrip when import then export 2023-09-25 12:10:55 +02:00
a75b59baa3 glTF exporter: Add option to choose number of bone influence 2023-09-25 12:08:58 +02:00
ceac431492 glTF exporter: Use sparse accessors when it leads to small files 2023-09-25 12:06:12 +02:00
15780ade32 glTF exporter: Single Armature with no animation data will not export all anims 2023-09-25 12:03:33 +02:00
9ccd934d19 glTF importer: Fix custom attribute import 2023-09-25 12:01:04 +02:00
5a505e38ee glTF exporter: Fix Real children of instance collection visibility check 2023-09-25 11:58:46 +02:00
462064c396 glTF exporter: Fix restore of track mute during track mode export 2023-09-25 11:56:38 +02:00
a6cc6a16cb glTF exporter: Fix traceback in animation track mode export 2023-09-25 11:54:48 +02:00
1b9e4fb268 GPencil Tools: Fix box deform operator
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
2023-09-23 22:00:56 +02:00
57cdb9e186 Rigify: update spline_tentacle to use modern inherit_scale settings. 2023-09-22 23:54:29 +03:00
1e1c191755 Rigify: update for fixes in rna_idprop_ui_create.
The precision and step attributes are now supported.
Also fix the min and max defaults same as in blender main.
2023-09-22 13:33:43 +03:00
c3918a3a71 UI: Update theme presets with missing fields and values
Update theme presets with missing fields and values.

I ran /utils_maintenance/blender_update_themes.py script to add new fields to the .XML theme presets.

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104899
2023-09-21 16:11:43 +02:00
08ba434789 Rigify: make panel expressions a bit more flexible.
Accept expressions in place of constants in more places.
Also, int() and float() really must return those types, so remove.
2023-09-21 12:08:06 +03:00
1467d62c79 Rigify: fix unreliable interpolation of limb tweak roll.
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.
2023-09-20 21:29:57 +03:00
dbcf99bb3b Rigify: add more hints for the user about adding layer UI buttons. 2023-09-20 19:02:11 +03:00
08af2f5035 Rigify: improve handling of the feature set list.
- 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.
2023-09-20 19:00:11 +03:00
621149bb57 Rigify: add the spline tentacle rig from the experimental feature set.
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.
2023-09-20 19:00:11 +03:00
61997a39e3 Pose Library: Tweak to the add-on description
The asset browser is now regarded as a mere UI, but there is also the
asset shelf now. All this is built on the asset system, so this is the
better term to use here.

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104889
2023-09-20 11:44:14 +02:00
62cf7b53c1 glTF importer: add missing volume in list of managed extensions 2023-09-19 22:08:53 +02:00
7bc4614eff glTF importer: reflect changes in Principled socket order 2023-09-19 21:55:48 +02:00
ab40b5bb58 Pose library: Update to reflect naming change in BPY
The term `asset_library_ref` was changed to `asset_library_reference` in
974d70918b.
2023-09-19 16:30:54 +02:00
adaf0aa064 Pose library: Use asset representation type instead of asset handle
See 591a1ae323.
2023-09-19 15:09:53 +02:00
bc801d7b1d Fix #104714: Missing shape keys in FBX export when original mesh data cannot be used
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
2023-09-19 02:26:16 +02:00
2b8d9bf2b8 FBX IO: Add support for armature data custom properties
Armature data custom properties are now imported from and exported to
the NodeAttribute connected to the Armature's Node.

This implements part of #104677.

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104888
2023-09-19 01:53:43 +02:00
fbcdfa34b9 FBX IO: Fix Empty export type control also affecting armatures
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
2023-09-19 01:32:24 +02:00
73c65b9a44 FBX IO: Speed up animation export using NumPy
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
2023-09-19 01:13:21 +02:00
c34736cbb8 Node Wrangler: ui_items collection renamed to items_tree
Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104896
2023-09-18 18:11:37 +02:00
42bba405f0 Fix #104893: Node wrangler: Shader node preview error with panels
This code mistook the interface items for sockets.
Sometimes they can be panels instead.
2023-09-18 11:15:03 -04:00
21c4924974 Rigify: add an api to use runtime-evaluated expressions in panel scripts.
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.
2023-09-18 09:31:43 +03:00
bcfed198d0 Rigify: alert the user if they forgot to assign any layer UI buttons.
This can be an easy mistake to make when making a metarig from scratch.
Also ensure that the Root collection always has a button assigned.
2023-09-17 10:39:28 +03:00
0c77065441 Rigify: add a utility class for managing helper objects.
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.
2023-09-16 17:07:06 +03:00
8f16645901 Rigify: adopt new leg features from the experimental feature set.
* 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.
2023-09-16 13:20:59 +03:00
b36844ec64 Rigify: keep the pole target switch as integer.
In 4.0 true boolean properties are supported, but for now keep it as int.
2023-09-16 13:20:59 +03:00
73f1732f26 Rigify: handle more rig types when upgrading layer references. 2023-09-16 12:22:35 +03:00
8f6b6bb465 UITranslate: Initial refactor/changes for repositories changes.
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
2023-09-15 18:08:04 +02:00
dcce2a85c5 Pose Library: Adding myself to authors list
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.
2023-09-15 16:33:52 +02:00