Previous patch location: https://archive.blender.org/developer/D16545
This patch addresses blender/blender#102376
A new writer is added, the usd_writer_curves.cc to handle transforming the new curves system into USD.
The goal was to enable export of the new curves type, but @HooglyBoogly mentioned there is a `curve_legacy_to_curves` utility function that could also handle converting legacy curves to the new Curves type. This very trivially enables the legacy curves for export too so I have included that change in this patch.
Co-authored-by: DESKTOP-ON14TH5\Sonny Campbell <sonny.campbell@unity3d.com>
Pull Request: blender/blender#105375
Update the XYZ Symmetry buttons if they are toggled without mouse
click, for example from a script or keyboard shortcut.
Pull Request: blender/blender#106679
This commit adds a new experimental node "Sample Volume".
It's purpose is to be able to sample values from a volume grid given
a position field.
The 'Grid' input accepts a named attribute input with the name
of the volume grid to sample. Values will be implicitly converted
from the grid type to the specified value type.
Pull Request: #107656
Internal private struct was using `owner_id`/`self_id`, while the public
callback data struct was using `id_owner`/`id_self`.
Now using internal naming everywhere in lib_query related code, as
`owner_id` is already used in very low-level 'fundamental' part of the
code, e.g. in the `PointerRNA` struct, or in ID's 'loopback' pointers
for embedded data.
Note that this is only a very small first step toward proper naming
consistency for these type of data, the mismatch is currently spread all
over the code base.
We also need to document more formally the meaning and differences
between `self` and `owner` here.
Fixes preview images not showing up in asset-view templates or the in
development asset shelf.
The sliding-window optimization to only load previews that are in view
(or close to it) can't really be used by the asset-list API, since
figuring out what's actually in view is a bit tricky. So we have to
ensure all previews are loaded for now.
This pull request addresses bug blender/blender#107633
Added logic to avoid creating duplicate Blender shader nodes when
converting USD Preview Surface shaders that are connected to more
than one input.
This change adds a `NodePlacementContext::node_cache` map to record
Blender nodes converted for given USD shaders. The node creation
logic has been updated to query this cache to check if a node was
previously created for a given USD shader, before creating a
new node.
Pull Request: blender/blender#107945
Using the topology map gives a constant time lookup, since it has a map
of nodes per type. The collada code used the old function, but had been
ifdef'd for four years, so it's removed here.
Functions were moved as part of f7388e3be5, which was
unnecessarily noisy. Instead of reverting, move the definitions back
to their original place in node.cc. Also move a few more things to
the blender::bke namespace.
Since a generic snap cursor was implemented (which can be used by Tools and by DragDrop), the Placement Settings are no longer a settings of the "VIEW3D_OT_interactive_add" Operator.
With that implementation, those properties started to be defined in a
static struct, filled in at runtime and accessed in the UI through
workarrounds.
As they are properties initialized at runtime, they are not saved in
the file.
The solution is to move the Placement Settings to `ToolSettings`.
Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: blender/blender#107951
- "Out" meaning "one end of a bone". Same as in 9120c86c3f.
- "Canvas" meaning a painting support for Dynamic Paint.
- "Twist" meaning an action verb, as opposed to an amount.
- "Solid" meaning a textureless, single-color material.
- "Blend mode" meaning material opacity blending, as opposed to color
blending.
- "Pixel Size" meaning "a size measured using pixels as the unit".
- "Light" meaning "not dark", as in "Light Theme".
Ref #43295
The previous two commits introduced new regexes to extract node socket
names and descriptions automatically from the i18n Python module,
including socket labels.
This commit removes the extraction macros from all node files since
they are now redundant.
Pull Request: blender/blender#107258
Add modulo function `mod_f_positive(f, n)` that returns a positive result,
regardless of the sign of `f`.
For example, `mod_f_positive(-0.1, 1.0)` returns `0.9`, whereas the
standard `fmodf()` function would return `-0.1`.
This is useful for rewrapping values to a specific interval.
The Quick Fur operator creates a curves object with hair modifiers and
a material.
These modifiers' and material's names can be translated if the user
chose to translate data in the preferences.
Only the modifier names are translated, the node groups are not
because they may be reused instead of appended again.
Pull Request: blender/blender#107909
Two new messages are extracted:
- "New" in the context of paint curves. Used for the template_ID to
create a new curve;
- "PaintCurve", the default name of a newly-created paint curve.
Pull Request: blender/blender#107888
A few new messages were extracted.
- "Catalog", the default name when creating a new catalog.
- Tooltips related to drag and dropping catalogs in the asset browser.
Some use `fmt::format()` as a possible solution to messages
currently extracted with string concatenation as mentioned in
#92758.
Pull Request: blender/blender#107710
Include the term "overwrite" so users of this function are aware
this function will delete the destination file (unlike LIBC rename).
- Add BLI_rename_overwrite (previously called BLI_rename).
- BLI_rename is now a wrapper for rename.
Use BLI_rename when renaming in the file selector.
This change was made to prevent renaming files in the file selector from
deleting the file, see: #12255 & [0]. This check is no longer needed as
file selectors now checks the destination doesn't exist before renaming.
Generally, having low level file handling functions behave differently
between platforms is something to avoid with the potential of leading
to unexpected behavior.
Also unify WIN32/UNIX BLI_rename.
[0]: 41ad6f9d0a
When the `from` file didn't exist, BLI_rename returned success,
the in-line doc-string was incorrect - remove in favor of the header's
doc-string. This error existed since the initial revision.
Note that this was fixed [0] for other systems.
[0]: 622019a085
Minor corrections including:
* Fast packer wasn't treating locked islands correctly.
* Pointer aliasing.
* Fix and some assumptions that might not be always true.
* Improve variable names.
* Improved comments.
In some languages, the A and B sockets need to be disambiguated
because because they can have different letters depending on context.
In Spanish, A is used for B (Blue -> Azul), while the greek letter
alpha is used for A, to disambiguate Azul / alpha.
Pull Request: blender/blender#107706
This pull request adds a 'root_prim_path' USD export string parameter. If this option is set to a well-formed prim path (e.g., '/World'), a transform primitive with the given path will be added to the stage as the parent of all exported primitives. This will allow transforming the scene by this root node in other applications and is also required for loading the exported scene as a reference in other USDs.
As part of this change, the '_materials' node, which contains all exported materials, is also created under the root prim. This is required so that materials are imported correctly when the USD is referenced in another stage.
Finally, added an export_params_valid() function to verify that the 'root_prim_path' is valid before starting the export job. This function can be extended in the future to perform additional validation of other export parameters.
This update combines work in pull request
blender/blender#104506
and an implementation in the 'universal-scene-description' branch.
Co-authored-by: Ashley Ruglys <ashley.ruglys@gmail.com>
Pull Request: blender/blender#107855
See: blender/blender#103343
Changes:
1. Added `BKE_node.hh` file. New file includes old one.
2. Functions moved to new file. Redundant `(void)`, `struct` are removed.
3. All cpp includes replaced from `.h` on `.hh`.
4. Everything in `BKE_node.hh` is on `blender::bke` namespace.
5. All implementation functions moved in namespace.
6. Function names (`BKE_node_*`) changed to `blender::bke::node_*`.
7. `eNodeSizePreset` now is a class, with renamed items.
Pull Request: blender/blender#107790
The issue was that in case an ID was only related to its liboverride
hierarchy through a 'to' pointer (e.g. the parent pointer of an object),
it would now be tagged as 'isolated' from its hierarchy, since nothing
in said hierarchy actually points to it. It would then be deleted during
resync process.
This is once again the infamous 'inverted dependency logic of object
parenting' case...
Note that this did not have any consequences on typical liboverride
usages (based on using a hierarchy of collections0, since all objects
would then be referenced by one or more collection.
Reported by @dr.sybren while investigating #102662.
Ensure the file path G.main->filepath is always absolute and normalized.
- It was possible to call WM_OT_open_mainfile with only a filename,
if this resolved from the CWD, Blender's internal filepath
would not be absolute as expected.
- It was possible to open files on UNIX with an additional forward slash
causing the blend file path it's self to contain a '//' prefix,
this is error prone as running BLI_path_abs(..) multiple times would
add the blend file prefix each time.
- Remove requirement for "filepath" to be an absolute path when saving.
Instead, expand the path - making it absolute, as this constraint
wasn't applied open opening files, prefer making save/open behave
consistently.
- Assert when BLI_path_abs/BLI_path_rel receive a basepath that has
a "//" (relative) prefix itself.
Add a new flag that determines whether root bones (i.e. bones without a
parent) should be translated to the armature object's origin. This can
be found in the Armature's IK properties panel.
By default this flag is disabled, so new rigs will not see this 'locking
to the origin' behaviour. Versioning code ensures that the flag is
enabled on older files, to preserve the behaviour of existing rigs.
This also bumps the Blender subversion and at the same time fixes an
incorrect bump in ee08b2ddff (where the
'minimum compatible version' was updated instead of the current Blender
version).
Pull request: blender/blender#107869
This patch implements the Convert Color Space node for the realtime
compositor. A custom OCIO GpuShaderCreator was implemented to use the
ShaderCreateInfo in constructing the OCIO GPU processor shader. That
shader is then cached inside the cache manager and is invalidated when
the OCIO configuration changes.
Pull Request: blender/blender#107878
Double-clicking between alpha-numeric & punctuation for e.g.
did nothing instead of selecting the word.
Instead of a special check for white-space, use the enum values as a
priority so alpha-numeric characters are priories above others
in a way that doesn't prevent groups of other character types
from being selected.
Having some arguments be input/output and others output only was
confusing, a function that detects a range from a position
can simply calculate the range - modifying the input position isn't
needed.
Instead, note that word select puts the cursor at the end by convention.
Also use `r_` prefix for output only arguments.