Move most of the string preprocessing used for MSL
compatibility to `glsl_preprocess`.
Enforce some changes like matrix constructor and
array constructor to the GLSL codebase. This is
for C++ compatibility.
Additionally reduce the amount of code duplication
inside the compatibility code.
Pull Request: https://projects.blender.org/blender/blender/pulls/128634
The issue was that the GLSL processor was incorrectly
processing an info.hh file which was also supposed to be
included inside the gpu module. The generated source
was creating build error.
`ActionSlot::idtype` needs some extra care when reading from a blend
file. Blender's generic endian switching needs to be un-done, as the
ID type values are not numerically the same between little and big
endian machines. Due to the way they are defined, they are always in
the same byte order, regardless of hardware/platform endianness.
This is the same for Action Slots as #128129 does for Actions, except
that Action Slots use a `int16_t` instead of `short` and thus don't
need a cast.
Pull Request: https://projects.blender.org/blender/blender/pulls/128438
Instead of setting the directory empty so it's initialized to the root,
use a variable which can be set when there are problems expanding the
path. This is then checked once at the end.
Also avoid inlining platform specific root directory access.
This was already done in GHOST, but not BKE_appdir_folder_home.
Also null check the return value from getpwuid() as it's not
guaranteed to be non-null.
Using `//` for unsaved files isn't meaningful, instead of replacing
with a "default" directory, clear the input to avoid confusing
users as to the meaning of the prefix.
Also pass arguments Main & FileSelectParams to file_expand_directory
instead of the context as this is a lower level function thats
only ever called when these values are known & doesn't run
the appropriate refresh functions needed to be called on it's own.
- Deduplicate Fisheye projection code
- Replace spherical/cartesian conversions with shared helpers
- Replace transforms from/to local coordinate systems with shared helpers
The main type of repeated transform that's not covered here is `to/from_coords`, but with separate values for xy and z (e.g. BSDFs that already computed `dot(wi, N)` earlier, so they only need `dot(wi, X)` and `dot(wi, Y)` later). Could also be replaced, but it would feel weirdly specific for a helper function.
Pull Request: https://projects.blender.org/blender/blender/pulls/125999
The `transformEvent` function is becoming increasingly complex due to
the inclusion of operation-specific code.
To improve this, remove the `handled` boolean and allow each
`TransModeInfo::handle_event_fn` to determine how to handle already
processed events.
Additionally, move some operation-specific logic to the operators file.
Note:
The `handled` boolean was added in aef307cf31 to fix a bug with the
custom events of the Edge and Vertex Slide operators;
It was possible to navigate to a CWD relative path if it was entered
in the directory and it happened to exist
(or entering relative paths: `./`, `../` etc).
After this, navigation in the file selector didn't work well, any paths
loaded would depend on the directory Blender was started in.
While CWD relative paths aren't prevented & can even be useful when
using paths passed in by scripts - there is no need for the file
selector to expose them to the user - potentially forwarding CWD
relative paths to operators where they can cause further problems.
Entering a single word (for example) in the file selectors directory
would ask to create the director, which then created the directory
relative to the processes CWD, then set a CWD relative path.
From the users perspective this is strange as it's unclear where
the directory was created the path would not show the CWD prefix.
Resolve by checking the path is absolute and at least one of the parent
paths exists before prompting the user to create the path.
Resolve part of the strange behavior from #128567.
The paths `C:` (on WIN32) and `/` on other systems was detecting as
relative. This meant `BLI_path_abs_from_cwd` would make both paths
CWD relative. Also remove duplicate call to BLI_path_is_unc.
Regression in [0] which didn't account for entering paths in the
file selector which would create paths without confirming,
warning that the "confirm" property was missing.
Entering `*.*` would create `_._` for e.g in the users CWD for example.
Ref !128568
[0]: 6dd0f6627e.
This is due to wrong `is_pad` is passed as argument. It should be false
for gizmo tooltips. For menus when fields size is zero i.e. no
element is appended yet, the python message will be at the top of
tooltip region.
Pull Request: https://projects.blender.org/blender/blender/pulls/128243