Initial Grease Pencil 3.0 stage #106848
|
@ -160,7 +160,7 @@ struct LightTreeNode {
|
|||
int num_prims = -1; /* The number of primitives a leaf node stores. A negative
|
||||
number indicates it is an inner node. */
|
||||
int first_prim_index; /* Leaf nodes contain an index to first primitive. */
|
||||
unique_ptr<LightTreeNode> children[2]; /* Inner node has two chlidren. */
|
||||
unique_ptr<LightTreeNode> children[2]; /* Inner node has two children. */
|
||||
|
||||
LightTreeNode() = default;
|
||||
|
||||
|
@ -192,7 +192,7 @@ struct LightTreeNode {
|
|||
* and considers additional orientation and energy information */
|
||||
class LightTree {
|
||||
unique_ptr<LightTreeNode> root_;
|
||||
atomic<int> num_nodes_ = 0;
|
||||
std::atomic<int> num_nodes_ = 0;
|
||||
uint max_lights_in_leaf_;
|
||||
|
||||
public:
|
||||
|
|
|
@ -557,7 +557,7 @@ if(WITH_XR_OPENXR)
|
|||
# Header only library.
|
||||
../../extern/tinygltf/tiny_gltf.h
|
||||
)
|
||||
list(APPEND INC
|
||||
list(APPEND INC_SYS
|
||||
../../extern/json/include
|
||||
../../extern/tinygltf
|
||||
)
|
||||
|
|
|
@ -4275,8 +4275,26 @@ static void gwl_seat_capability_pointer_enable(GWL_Seat *seat)
|
|||
seat->cursor.visible = true;
|
||||
seat->cursor.wl_buffer = nullptr;
|
||||
if (!get_cursor_settings(seat->cursor.theme_name, seat->cursor.theme_size)) {
|
||||
seat->cursor.theme_name = std::string();
|
||||
/* Use environment variables, falling back to defaults.
|
||||
* These environment variables are used by enough WAYLAND applications
|
||||
* that it makes sense to check them (see `Xcursor` man page). */
|
||||
const char *env;
|
||||
|
||||
env = getenv("XCURSOR_THEME");
|
||||
seat->cursor.theme_name = std::string(env ? env : "");
|
||||
|
||||
env = getenv("XCURSOR_SIZE");
|
||||
seat->cursor.theme_size = default_cursor_size;
|
||||
|
||||
if (env && (*env != '\0')) {
|
||||
char *env_end = nullptr;
|
||||
/* While clamping is not needed on the WAYLAND side,
|
||||
* GHOST's internal logic may get confused by negative values, so ensure it's at least 1. */
|
||||
const long value = strtol(env, &env_end, 10);
|
||||
if ((*env_end == '\0') && (value > 0)) {
|
||||
seat->cursor.theme_size = int(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
wl_pointer_add_listener(seat->wl_pointer, &pointer_listener, seat);
|
||||
|
||||
|
|
|
@ -224,7 +224,8 @@ string(APPEND CMAKE_CXX_FLAGS " ${PLATFORM_CFLAGS}")
|
|||
|
||||
# Gears (C)
|
||||
add_executable(gears_c
|
||||
${CMAKE_SOURCE_DIR}/gears/GHOST_C-Test.c)
|
||||
${CMAKE_SOURCE_DIR}/gears/GHOST_C-Test.c
|
||||
)
|
||||
|
||||
target_link_libraries(gears_c
|
||||
ghost_lib
|
||||
|
@ -237,7 +238,8 @@ target_link_libraries(gears_c
|
|||
|
||||
# Gears (C++)
|
||||
add_executable(gears_cpp
|
||||
${CMAKE_SOURCE_DIR}/gears/GHOST_Test.cpp)
|
||||
${CMAKE_SOURCE_DIR}/gears/GHOST_Test.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(gears_cpp
|
||||
ghost_lib
|
||||
|
|
|
@ -28,6 +28,9 @@ https://github.com/intel/llvm#oneapi-dpc-compiler
|
|||
** Intel® Open Path Guiding Library; version v0.4.1-beta --
|
||||
http://www.openpgl.org/
|
||||
** Mantaflow; version 0.13 -- http://mantaflow.com/
|
||||
** materialX; version 1.38.6 --
|
||||
https://github.com/AcademySoftwareFoundation/MaterialX
|
||||
** meson; version 0.63 -- https://github.com/mesonbuild/meson
|
||||
** oneAPI Threading Building Block; version 2020_U3 --
|
||||
https://software.intel.com/en-us/oneapi/onetbb
|
||||
** OpenCL Wrangler; version 27a6867 -- https://github.com/OpenCLWrangler/clew
|
||||
|
@ -37,6 +40,9 @@ https://software.intel.com/en-us/oneapi/onetbb
|
|||
** RangeTree; version 40ebed8aa209 -- https://github.com/ideasman42/rangetree-c
|
||||
** SDL Extension Wrangler; version 15edf8e --
|
||||
https://github.com/SDLWrangler/sdlew
|
||||
** ShaderC; version 2022.3 -- https://github.com/google/shaderc
|
||||
** Vulkan Loader; version 1.2.198 --
|
||||
https://github.com/KhronosGroup/Vulkan-Loader
|
||||
|
||||
Apache License
|
||||
|
||||
|
@ -251,6 +257,11 @@ limitations under the License.
|
|||
* For Mantaflow see also this required NOTICE:
|
||||
MantaFlow fluid solver framework
|
||||
Copyright 2011 Tobias Pfaff, Nils Thuerey
|
||||
* For materialX see also this required NOTICE:
|
||||
Copyright Contributors to the MaterialX Project
|
||||
* For meson see also this required NOTICE:
|
||||
Jussi Pakkanen
|
||||
https://github.com/mesonbuild/meson/blob/master/CODEOWNERS
|
||||
* For oneAPI Threading Building Block see also this required NOTICE:
|
||||
Copyright (c) 2005-2020 Intel Corporation
|
||||
* For OpenCL Wrangler see also this required NOTICE:
|
||||
|
@ -270,6 +281,49 @@ limitations under the License.
|
|||
Copyright (c) 2016, Campbell Barton.
|
||||
* For SDL Extension Wrangler see also this required NOTICE:
|
||||
Copyright 2014 Blender Foundation
|
||||
* For ShaderC see also this required NOTICE:
|
||||
Copyright 2015 The Shaderc Authors. All rights reserved.
|
||||
* For Vulkan Loader see also this required NOTICE:
|
||||
Copyright (c) 2019 The Khronos Group Inc.
|
||||
Copyright (c) 2019 Valve Corporation
|
||||
Copyright (c) 2019 LunarG, Inc.
|
||||
Copyright (c) 2019 Google Inc.
|
||||
|
||||
------
|
||||
|
||||
** pybind11; version 2.10.1 -- https://github.com/pybind/pybind11
|
||||
Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.
|
||||
|
||||
Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Please also refer to the file .github/CONTRIBUTING.md, which clarifies
|
||||
licensing of
|
||||
external contributions to this project including patches, pull requests, etc.
|
||||
|
||||
------
|
||||
|
||||
|
@ -330,20 +384,21 @@ All rights reserved.
|
|||
Contributors to the OpenEXR Project.
|
||||
** ISPC; version 1.17.0 -- https://github.com/ispc/ispc
|
||||
Copyright Intel Corporation
|
||||
** NumPy; version 1.22.0 -- https://numpy.org/
|
||||
** NumPy; version 1.23.5 -- https://numpy.org/
|
||||
Copyright (c) 2005-2021, NumPy Developers.
|
||||
** Ogg; version 1.3.5 -- https://www.xiph.org/ogg/
|
||||
COPYRIGHT (C) 1994-2019 by the Xiph.Org Foundation https://www.xiph.org/
|
||||
** Open Shading Language; version 1.12.6.2 --
|
||||
** Open Shading Language; version
|
||||
1.13-dev-1a7670600c8b08c2443a78d03c8c27e9a1149140 --
|
||||
https://github.com/imageworks/OpenShadingLanguage
|
||||
Copyright Contributors to the Open Shading Language project.
|
||||
** OpenColorIO; version 2.1.1 --
|
||||
** OpenColorIO; version 2.2.0 --
|
||||
https://github.com/AcademySoftwareFoundation/OpenColorIO
|
||||
Copyright Contributors to the OpenColorIO Project.
|
||||
** OpenEXR; version 3.1.5 --
|
||||
https://github.com/AcademySoftwareFoundation/openexr
|
||||
Copyright Contributors to the OpenEXR Project. All rights reserved.
|
||||
** OpenImageIO; version 2.3.20.0 -- http://www.openimageio.org
|
||||
** OpenImageIO; version 2.4.6.0 -- http://www.openimageio.org
|
||||
Copyright (c) 2008-present by Contributors to the OpenImageIO project. All
|
||||
Rights Reserved.
|
||||
** Pystring; version 1.1.3 -- https://github.com/imageworks/pystring
|
||||
|
@ -1533,6 +1588,9 @@ License.
|
|||
** Eigen, template library for linear algebra: matrices, vectors, numerical
|
||||
solvers, and related algorithms; version 3.2.7 --
|
||||
http://eigen.tuxfamily.org/index.php?title=Main_Page
|
||||
Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>, Copyright
|
||||
(C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com
|
||||
|
||||
This file is part of Eigen, a lightweight C++ template library for linear
|
||||
algebra.
|
||||
** Free Spacenav; version 0.2.3 --
|
||||
|
@ -2190,8 +2248,557 @@ of this License. But first, please read <http s ://www.gnu.org/ licenses
|
|||
|
||||
------
|
||||
|
||||
** Fribidi ; version 1.0.12 -- https://github.com/fribidi/fribidi
|
||||
Behdad Esfahbod <behdad@gnu.org>
|
||||
#
|
||||
# Behdad Esfahbod maintained the entire 0.19 series. He designed, and
|
||||
# implemented most of what is in FriBidi today.
|
||||
#
|
||||
|
||||
Dov Grobgeld <dov.grobgeld@gmail.com>
|
||||
#
|
||||
# Dov Grobgeld originally wrote FriBidi. The 0.1.* releases were all done
|
||||
# by him. After the a long time of not being involved, Dov received
|
||||
# back the maintenance of the package in time for the 1.0 release.
|
||||
# He did the entire algorithmic work to support the changes made
|
||||
# to the Unicode algorithm in the Unicode 6.3 standard.
|
||||
#
|
||||
|
||||
Roozbeh Pournader <roozbeh@gnu.org>
|
||||
#
|
||||
# Roozbeh Pournader hasn't contributed much code to FriBidi personally; but
|
||||
# has maintained, promoted, and supported the project for a while. He has
|
||||
# helped with making GNU FriBidi standards compliant, and has sometimes
|
||||
# lobbied with the Unicode Consortium when needed. Roozbeh was supposed to
|
||||
# be a co-maintainer of GNU FriBidi, but he's not doing that yet.
|
||||
#
|
||||
|
||||
Khaled Hosny <khaledhosny@eglug.org>
|
||||
#
|
||||
# Khaled Hosny has done lots of cleanup and autoconfig work.
|
||||
|
||||
# Note: Other people have contributed significant amounts of code, but
|
||||
# usually the code has faded out because of restructuring and redesigning
|
||||
# things around GNU FriBidi. As an example, the FriBidiEnv patch by Omer
|
||||
# Zak, made itself into FriBidi CVS for a couple of years, but was finally
|
||||
# implemented in a better way by Behdad.
|
||||
#
|
||||
# Note: GNU getopt is distributed with and used in GNU FriBidi under bin/, but
|
||||
# is not part of GNU FriBidi.
|
||||
#
|
||||
# Note: Parts of the Unicode Character Database are distributed with and used
|
||||
# in GNU FriBidi under gen.tab/unidata/, but are not part of GNU FriBidi.
|
||||
#
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
------
|
||||
|
||||
** FFmpeg; version 5.1.2 -- http://ffmpeg.org/
|
||||
-
|
||||
Copyright: The FFmpeg contributors
|
||||
https://github.com/FFmpeg/FFmpeg/blob/master/CREDITS
|
||||
** Libsndfile; version 1.1.0 -- http://libsndfile.github.io/libsndfile/
|
||||
Copyright (C) 2011-2016 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
|
||||
|
@ -2899,7 +3506,71 @@ SOFTWARE.
|
|||
|
||||
------
|
||||
|
||||
** OpenVDB; version 9.0.0 -- http://www.openvdb.org/
|
||||
** Harfbuzz; version 5.1.0 -- https://github.com/harfbuzz/harfbuzz
|
||||
Copyright © 2010-2022 Google, Inc.
|
||||
Copyright © 2015-2020 Ebrahim Byagowi
|
||||
Copyright © 2019,2020 Facebook, Inc.
|
||||
Copyright © 2012,2015 Mozilla Foundation
|
||||
Copyright © 2011 Codethink Limited
|
||||
Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies)
|
||||
Copyright © 2009 Keith Stribley
|
||||
Copyright © 2011 Martin Hosken and SIL International
|
||||
Copyright © 2007 Chris Wilson
|
||||
Copyright © 2005,2006,2020,2021,2022,2023 Behdad Esfahbod
|
||||
Copyright © 2004,2007,2008,2009,2010,2013,2021,2022,2023 Red Hat, Inc.
|
||||
Copyright © 1998-2005 David Turner and Werner Lemberg
|
||||
Copyright © 2016 Igalia S.L.
|
||||
Copyright © 2022 Matthias Clasen
|
||||
Copyright © 2018,2021 Khaled Hosny
|
||||
Copyright © 2018,2019,2020 Adobe, Inc
|
||||
Copyright © 2013-2015 Alexei Podtelezhnikov
|
||||
|
||||
HarfBuzz is licensed under the so-called "Old MIT" license. Details follow.
|
||||
For parts of HarfBuzz that are licensed under different licenses see individual
|
||||
files names COPYING in subdirectories where applicable.
|
||||
|
||||
Copyright © 2010-2022 Google, Inc.
|
||||
Copyright © 2015-2020 Ebrahim Byagowi
|
||||
Copyright © 2019,2020 Facebook, Inc.
|
||||
Copyright © 2012,2015 Mozilla Foundation
|
||||
Copyright © 2011 Codethink Limited
|
||||
Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies)
|
||||
Copyright © 2009 Keith Stribley
|
||||
Copyright © 2011 Martin Hosken and SIL International
|
||||
Copyright © 2007 Chris Wilson
|
||||
Copyright © 2005,2006,2020,2021,2022,2023 Behdad Esfahbod
|
||||
Copyright © 2004,2007,2008,2009,2010,2013,2021,2022,2023 Red Hat, Inc.
|
||||
Copyright © 1998-2005 David Turner and Werner Lemberg
|
||||
Copyright © 2016 Igalia S.L.
|
||||
Copyright © 2022 Matthias Clasen
|
||||
Copyright © 2018,2021 Khaled Hosny
|
||||
Copyright © 2018,2019,2020 Adobe, Inc
|
||||
Copyright © 2013-2015 Alexei Podtelezhnikov
|
||||
|
||||
For full copyright notices consult the individual files in the package.
|
||||
|
||||
|
||||
Permission is hereby granted, without written agreement and without
|
||||
license or royalty fees, to use, copy, modify, and distribute this
|
||||
software and its documentation for any purpose, provided that the
|
||||
above copyright notice and the following two paragraphs appear in
|
||||
all copies of this software.
|
||||
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
||||
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
||||
IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
|
||||
THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
||||
ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
||||
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
|
||||
------
|
||||
|
||||
** OpenVDB; version 10.0.0 -- http://www.openvdb.org/
|
||||
Copyright Contributors to the OpenVDB Project
|
||||
|
||||
Mozilla Public License Version 2.0
|
||||
|
@ -3238,6 +3909,32 @@ the Mozilla Public License, v. 2.0.
|
|||
|
||||
------
|
||||
|
||||
** minizip-ng; version 3.0.7 -- https://github.com/zlib-ng/minizip-ng
|
||||
Copyright (C) Nathan Moinvaziri
|
||||
https://github.com/zlib-ng/minizip-ng
|
||||
Copyright (C) 1998-2010 Gilles Vollant
|
||||
https://www.winimage.com/zLibDll/minizip.html
|
||||
|
||||
Condition of use and distribution are the same as zlib:
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgement in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
------
|
||||
|
||||
** Bullet Continuous Collision Detection and Physics Library; version 3.07 --
|
||||
http://continuousphysics.com/Bullet/
|
||||
Bullet Continuous Collision Detection and Physics Library
|
||||
|
@ -3330,9 +4027,9 @@ Software.
|
|||
|
||||
------
|
||||
|
||||
** OpenSubdiv; version 3.4.4 -- http://graphics.pixar.com/opensubdiv
|
||||
** OpenSubdiv; version 3.5.0 -- http://graphics.pixar.com/opensubdiv
|
||||
Copyright 2013 Pixar
|
||||
** Universal Scene Description; version 22.03 -- http://www.openusd.org/
|
||||
** Universal Scene Description; version 22.11 -- http://www.openusd.org/
|
||||
Copyright 2016 Pixar
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "Apache License") with the
|
||||
|
@ -3377,8 +4074,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
------
|
||||
|
||||
** Boost C++ Libraries; version 1.78.0 -- https://www.boost.org/
|
||||
-
|
||||
** Boost C++ Libraries; version 1.80.0 -- https://www.boost.org/
|
||||
The Boost license encourages both commercial and non-commercial use and does
|
||||
not require attribution for binary use.
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
|
@ -3542,7 +4240,7 @@ MIT Expat
|
|||
|
||||
------
|
||||
|
||||
** Python; version 3.10.8 -- https://www.python.org
|
||||
** Python; version 3.10.9 -- https://www.python.org
|
||||
Copyright (c) 2001-2021 Python Software Foundation. All rights reserved.
|
||||
|
||||
A. HISTORY OF THE SOFTWARE
|
||||
|
|
|
@ -928,6 +928,55 @@ def dump_template_messages(msgs, reports, settings):
|
|||
reports, None, settings)
|
||||
|
||||
|
||||
def dump_asset_messages(msgs, reports, settings):
|
||||
# Where to search for assets, relative to the local user resources.
|
||||
assets_dir = os.path.join(bpy.utils.resource_path('LOCAL'), "datafiles", "assets")
|
||||
|
||||
# Parse the catalog sidecar file
|
||||
catalog_file = os.path.join(assets_dir, settings.ASSET_CATALOG_FILE)
|
||||
with open(catalog_file, encoding="utf8") as f:
|
||||
data = f.readlines()
|
||||
|
||||
catalogs = set()
|
||||
|
||||
for line in data:
|
||||
if (line == "\n" or line.startswith("VERSION") or line.startswith("#")):
|
||||
continue
|
||||
_UUID, catalog_path, _simple_catalog_name = line.split(":")
|
||||
catalogs.update(catalog_path.split("/"))
|
||||
|
||||
msgsrc = "Asset catalog from " + settings.ASSET_CATALOG_FILE
|
||||
for catalog in sorted(catalogs):
|
||||
process_msg(msgs, settings.DEFAULT_CONTEXT, catalog, msgsrc,
|
||||
reports, None, settings)
|
||||
|
||||
# Parse the asset blend files
|
||||
asset_files = {}
|
||||
|
||||
bfiles = glob.glob(assets_dir + "/**/*.blend", recursive=True)
|
||||
for bfile in bfiles:
|
||||
basename = os.path.basename(bfile)
|
||||
bpy.ops.wm.open_mainfile(filepath=bfile)
|
||||
# For now, only parse node groups.
|
||||
# Perhaps some other assets will need to be extracted later?
|
||||
for asset_type in ("node_groups",):
|
||||
for asset in getattr(bpy.data, asset_type):
|
||||
if asset.asset_data is None: # Not an asset
|
||||
continue
|
||||
assets = asset_files.setdefault(basename, [])
|
||||
assets.append((asset.name, asset.asset_data.description))
|
||||
|
||||
for asset_file in sorted(asset_files):
|
||||
for asset in sorted(asset_files[asset_file]):
|
||||
name, description = asset
|
||||
msgsrc = "Asset name from file " + asset_file
|
||||
process_msg(msgs, settings.DEFAULT_CONTEXT, name, msgsrc,
|
||||
reports, None, settings)
|
||||
msgsrc = "Asset description from file " + asset_file
|
||||
process_msg(msgs, settings.DEFAULT_CONTEXT, description, msgsrc,
|
||||
reports, None, settings)
|
||||
|
||||
|
||||
def dump_addon_bl_info(msgs, reports, module, settings):
|
||||
for prop in ('name', 'location', 'description', 'warning'):
|
||||
process_msg(
|
||||
|
@ -980,6 +1029,7 @@ def dump_messages(do_messages, do_checks, settings):
|
|||
dump_preset_messages(msgs, reports, settings)
|
||||
|
||||
# Get strings from startup templates.
|
||||
# This loads each startup blend file in turn.
|
||||
dump_template_messages(msgs, reports, settings)
|
||||
|
||||
# Get strings from addons' bl_info.
|
||||
|
@ -1019,6 +1069,10 @@ def dump_messages(do_messages, do_checks, settings):
|
|||
process_msg(msgs, settings.DEFAULT_CONTEXT, cat[1],
|
||||
"Language categories’ labels from bl_i18n_utils/settings.py", reports, None, settings)
|
||||
|
||||
# Get strings from asset catalogs and blend files.
|
||||
# This loads each asset blend file in turn.
|
||||
dump_asset_messages(msgs, reports, settings)
|
||||
|
||||
# pot.check()
|
||||
pot.unescape() # Strings gathered in py/C source code may contain escaped chars...
|
||||
print_info(reports, pot)
|
||||
|
|
|
@ -527,6 +527,9 @@ REL_PRESETS_DIR = os.path.join("scripts", "presets")
|
|||
# Where to search for templates (relative to SOURCE_DIR).
|
||||
REL_TEMPLATES_DIR = os.path.join("scripts", "startup", "bl_app_templates_system")
|
||||
|
||||
# Name of the built-in asset catalog file.
|
||||
ASSET_CATALOG_FILE = "blender_assets.cats.txt"
|
||||
|
||||
# The template messages file (relative to I18N_DIR).
|
||||
REL_FILE_NAME_POT = os.path.join(REL_BRANCHES_DIR, DOMAIN + ".pot")
|
||||
|
||||
|
|
|
@ -81,6 +81,9 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
|
|||
sub.active = arm.show_axes
|
||||
sub.prop(arm, "axes_position", text="Position")
|
||||
|
||||
sub = col.row(align=True)
|
||||
sub.prop(arm, "relation_line_position", text="Relations", expand=True)
|
||||
|
||||
|
||||
class DATA_MT_bone_group_context_menu(Menu):
|
||||
bl_label = "Bone Group Specials"
|
||||
|
|
|
@ -8,34 +8,34 @@
|
|||
*
|
||||
* Basic design of the DerivedMesh system:
|
||||
*
|
||||
* DerivedMesh is a common set of interfaces for mesh systems.
|
||||
* #DerivedMesh is a common set of interfaces for mesh systems.
|
||||
*
|
||||
* There are three main mesh data structures in Blender:
|
||||
* #Mesh, #CDDerivedMesh and #BMesh.
|
||||
*
|
||||
* These, and a few others, all implement DerivedMesh interfaces,
|
||||
* These, and a few others, all implement #DerivedMesh interfaces,
|
||||
* which contains unified drawing interfaces, a few utility interfaces,
|
||||
* and a bunch of read-only interfaces intended mostly for conversion from
|
||||
* one format to another.
|
||||
*
|
||||
* All Mesh structures in blender make use of CustomData, which is used to store
|
||||
* per-element attributes and interpolate them (e.g. uvs, vcols, vgroups, etc).
|
||||
* All Mesh structures in blender make use of #CustomData, which is used to store
|
||||
* per-element attributes and interpolate them (e.g. UVs, vertex-colors, vertex-groups, etc).
|
||||
*
|
||||
* Mesh is the "serialized" structure, used for storing object-mode mesh data
|
||||
* and also for saving stuff to disk. Its interfaces are also what DerivedMesh
|
||||
* and also for saving stuff to disk. Its interfaces are also what #DerivedMesh
|
||||
* uses to communicate with.
|
||||
*
|
||||
* CDDM is a little mesh library, that uses Mesh data structures in the backend.
|
||||
* #CDDM is a little mesh library, that uses Mesh data structures in the backend.
|
||||
* It's mostly used for modifiers, and has the advantages of not taking much
|
||||
* resources.
|
||||
*
|
||||
* BMesh is a full-on BREP, used for edit-mode, some modifiers, etc. It's much
|
||||
* more capable (if memory-intensive) then CDDM.
|
||||
* #BMesh is a full-on BREP, used for edit-mode, some modifiers, etc.
|
||||
* It's much more capable (if memory-intensive) then CDDM.
|
||||
*
|
||||
* DerivedMesh is somewhat hackish. Many places assumes that a DerivedMesh is
|
||||
* #DerivedMesh is somewhat hackish. Many places assumes that a #DerivedMesh is
|
||||
* a CDDM (most of the time by simply copying it and converting it to one).
|
||||
* CDDM is the original structure for modifiers, but has since been superseded
|
||||
* by BMesh, at least for the foreseeable future.
|
||||
* by #BMesh, at least for the foreseeable future.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -217,7 +217,11 @@ bool BKE_collection_object_cyclic_check(struct Main *bmain,
|
|||
|
||||
struct ListBase BKE_collection_object_cache_get(struct Collection *collection);
|
||||
ListBase BKE_collection_object_cache_instanced_get(struct Collection *collection);
|
||||
/** Free the object cache of given `collection` and all of its ancestors (recursively). */
|
||||
void BKE_collection_object_cache_free(struct Collection *collection);
|
||||
/** Free the object cache of all collections in given `bmain`, including master collections of
|
||||
* scenes. */
|
||||
void BKE_main_collections_object_cache_free(const struct Main *bmain);
|
||||
|
||||
struct Base *BKE_collection_or_layer_objects(const struct Scene *scene,
|
||||
struct ViewLayer *view_layer,
|
||||
|
|
|
@ -493,11 +493,34 @@ struct ImBuf *BKE_image_get_first_ibuf(struct Image *image);
|
|||
*/
|
||||
struct GPUTexture *BKE_image_create_gpu_texture_from_ibuf(struct Image *image, struct ImBuf *ibuf);
|
||||
|
||||
/**
|
||||
* Ensure that the cached GPU texture inside the image matches the pass, layer, and view of the
|
||||
* given image user, if not, invalidate the cache such that the next call to the GPU texture
|
||||
* retrieval functions such as BKE_image_get_gpu_texture updates the cache with an image that
|
||||
* matches the give image user.
|
||||
*
|
||||
* This is provided as a separate function and not implemented as part of the GPU texture retrieval
|
||||
* functions because the current cache system only allows a single pass, layer, and stereo view to
|
||||
* be cached, so possible frequent invalidations of the cache can have performance implications,
|
||||
* and making invalidation explicit by calling this function will help make that clear and pave the
|
||||
* way for a more complete cache system in the future.
|
||||
*/
|
||||
void BKE_image_ensure_gpu_texture(struct Image *image, struct ImageUser *iuser);
|
||||
|
||||
/**
|
||||
* Get the #GPUTexture for a given `Image`.
|
||||
*
|
||||
* `iuser` and `ibuf` are mutual exclusive parameters. The caller can pass the `ibuf` when already
|
||||
* available. It is also required when requesting the #GPUTexture for a render result.
|
||||
*
|
||||
* The requested GPU texture will be cached for subsequent calls, but only a single layer, pass,
|
||||
* and view can be cached at a time, so the cache should be invalidated in operators and RNA
|
||||
* callbacks that change the layer, pass, or view of the image to maintain a correct cache state.
|
||||
* However, in some cases, multiple layers, passes, or views might be needed at the same time, like
|
||||
* is the case for the realtime compositor. This is currently not supported, so the caller should
|
||||
* ensure that the requested layer is indeed the cached one and invalidated the cached otherwise by
|
||||
* calling BKE_image_ensure_gpu_texture. This is a workaround until image can support a more
|
||||
* complete caching system.
|
||||
*/
|
||||
struct GPUTexture *BKE_image_get_gpu_texture(struct Image *image,
|
||||
struct ImageUser *iuser,
|
||||
|
|
|
@ -54,6 +54,9 @@ const char *no_procedural_access_message =
|
|||
|
||||
bool allow_procedural_attribute_access(StringRef attribute_name)
|
||||
{
|
||||
if (attribute_name.startswith(".corner")) {
|
||||
return false;
|
||||
}
|
||||
if (attribute_name.startswith(".select")) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -82,6 +82,8 @@ static CollectionParent *collection_find_parent(Collection *child, Collection *c
|
|||
static bool collection_find_child_recursive(const Collection *parent,
|
||||
const Collection *collection);
|
||||
|
||||
static void collection_object_cache_free(Collection *collection);
|
||||
|
||||
static void collection_gobject_hash_ensure(Collection *collection);
|
||||
static void collection_gobject_hash_update_object(Collection *collection,
|
||||
Object *ob_old,
|
||||
|
@ -160,7 +162,7 @@ static void collection_free_data(ID *id)
|
|||
BLI_freelistN(&collection->children);
|
||||
BLI_freelistN(&collection->runtime.parents);
|
||||
|
||||
BKE_collection_object_cache_free(collection);
|
||||
collection_object_cache_free(collection);
|
||||
}
|
||||
|
||||
static void collection_foreach_id(ID *id, LibraryForeachIDData *data)
|
||||
|
@ -887,16 +889,28 @@ static void collection_object_cache_free(Collection *collection)
|
|||
collection->flag &= ~(COLLECTION_HAS_OBJECT_CACHE | COLLECTION_HAS_OBJECT_CACHE_INSTANCED);
|
||||
BLI_freelistN(&collection->runtime.object_cache);
|
||||
BLI_freelistN(&collection->runtime.object_cache_instanced);
|
||||
}
|
||||
|
||||
void BKE_collection_object_cache_free(Collection *collection)
|
||||
{
|
||||
collection_object_cache_free(collection);
|
||||
|
||||
LISTBASE_FOREACH (CollectionParent *, parent, &collection->runtime.parents) {
|
||||
collection_object_cache_free(parent->collection);
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_collection_object_cache_free(Collection *collection)
|
||||
void BKE_main_collections_object_cache_free(const Main *bmain)
|
||||
{
|
||||
for (Scene *scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) {
|
||||
collection_object_cache_free(scene->master_collection);
|
||||
}
|
||||
|
||||
for (Collection *collection = bmain->collections.first; collection != NULL;
|
||||
collection = collection->id.next) {
|
||||
collection_object_cache_free(collection);
|
||||
}
|
||||
}
|
||||
|
||||
Base *BKE_collection_or_layer_objects(const Scene *scene,
|
||||
ViewLayer *view_layer,
|
||||
|
|
|
@ -336,6 +336,20 @@ static void image_gpu_texture_try_partial_update(Image *image, ImageUser *iuser)
|
|||
}
|
||||
}
|
||||
|
||||
void BKE_image_ensure_gpu_texture(Image *image, ImageUser *image_user)
|
||||
{
|
||||
if (!image) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Note that the image can cache both stereo views, so we only invalidate the cache if the view
|
||||
* index is more than 2. */
|
||||
if (image->gpu_pass != image_user->pass || image->gpu_layer != image_user->layer ||
|
||||
(image->gpu_view != image_user->multi_index && image_user->multi_index >= 2)) {
|
||||
BKE_image_partial_update_mark_full_update(image);
|
||||
}
|
||||
}
|
||||
|
||||
static GPUTexture *image_get_gpu_texture(Image *ima,
|
||||
ImageUser *iuser,
|
||||
ImBuf *ibuf,
|
||||
|
@ -365,6 +379,9 @@ static GPUTexture *image_get_gpu_texture(Image *ima,
|
|||
ima->gpu_pass = requested_pass;
|
||||
ima->gpu_layer = requested_layer;
|
||||
ima->gpu_view = requested_view;
|
||||
/* The cache should be invalidated here, but it is intentionally isn't due to possible
|
||||
* performance implications, see the BKE_image_ensure_gpu_texture function for more
|
||||
* information. */
|
||||
}
|
||||
#undef GPU_FLAGS_TO_CHECK
|
||||
|
||||
|
|
|
@ -1431,6 +1431,8 @@ void BKE_main_collection_sync_remap(const Main *bmain)
|
|||
/* On remapping of object or collection pointers free caches. */
|
||||
/* TODO: try to make this faster */
|
||||
|
||||
BKE_main_collections_object_cache_free(bmain);
|
||||
|
||||
for (Scene *scene = static_cast<Scene *>(bmain->scenes.first); scene;
|
||||
scene = static_cast<Scene *>(scene->id.next)) {
|
||||
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
|
||||
|
@ -1447,14 +1449,12 @@ void BKE_main_collection_sync_remap(const Main *bmain)
|
|||
view_layer_bases_hash_create(view_layer, true);
|
||||
}
|
||||
|
||||
BKE_collection_object_cache_free(scene->master_collection);
|
||||
DEG_id_tag_update_ex((Main *)bmain, &scene->master_collection->id, ID_RECALC_COPY_ON_WRITE);
|
||||
DEG_id_tag_update_ex((Main *)bmain, &scene->id, ID_RECALC_COPY_ON_WRITE);
|
||||
}
|
||||
|
||||
for (Collection *collection = static_cast<Collection *>(bmain->collections.first); collection;
|
||||
collection = static_cast<Collection *>(collection->id.next)) {
|
||||
BKE_collection_object_cache_free(collection);
|
||||
DEG_id_tag_update_ex((Main *)bmain, &collection->id, ID_RECALC_COPY_ON_WRITE);
|
||||
}
|
||||
|
||||
|
@ -2514,9 +2514,8 @@ ViewLayerAOV *BKE_view_layer_add_aov(ViewLayer *view_layer)
|
|||
|
||||
void BKE_view_layer_remove_aov(ViewLayer *view_layer, ViewLayerAOV *aov)
|
||||
{
|
||||
if (aov == nullptr || BLI_findindex(&view_layer->aovs, aov) == -1) {
|
||||
return;
|
||||
}
|
||||
BLI_assert(BLI_findindex(&view_layer->aovs, aov) != -1);
|
||||
BLI_assert(aov != nullptr);
|
||||
if (view_layer->active_aov == aov) {
|
||||
if (aov->next) {
|
||||
viewlayer_aov_active_set(view_layer, aov->next);
|
||||
|
|
|
@ -3598,9 +3598,9 @@ void sbObjectStep(struct Depsgraph *depsgraph,
|
|||
/* pass */
|
||||
}
|
||||
else if (/*ob->id.lib || */
|
||||
/* "library linking & pointcaches" has to be solved properly at some point */
|
||||
/* "library linking & point-caches" has to be solved properly at some point. */
|
||||
(cache->flag & PTCACHE_BAKED)) {
|
||||
/* if baked and nothing in cache, do nothing */
|
||||
/* If baked and nothing in cache, do nothing. */
|
||||
if (can_write_cache) {
|
||||
BKE_ptcache_invalidate(cache);
|
||||
}
|
||||
|
|
|
@ -312,7 +312,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss,
|
|||
int nverts = poly.totloop;
|
||||
int j, j_next;
|
||||
CCGFace *origf = ccgSubSurf_getFace(origss, POINTER_FROM_INT(i));
|
||||
/* uint *fv = &poly.v1; */
|
||||
// uint *fv = &poly.v1;
|
||||
|
||||
fverts.reinitialize(nverts);
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ template<typename T> class OffsetIndices {
|
|||
Span<T> offsets_;
|
||||
|
||||
public:
|
||||
OffsetIndices() = default;
|
||||
OffsetIndices(const Span<T> offsets) : offsets_(offsets)
|
||||
{
|
||||
BLI_assert(std::is_sorted(offsets_.begin(), offsets_.end()));
|
||||
|
|
|
@ -13,11 +13,12 @@ set(INC
|
|||
../../../intern/atomic
|
||||
../../../intern/eigen
|
||||
../../../intern/guardedalloc
|
||||
../../../extern/wcwidth
|
||||
../../../extern/json/include
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
../../../extern/wcwidth
|
||||
../../../extern/json/include
|
||||
|
||||
${EIGEN3_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
${ZSTD_INCLUDE_DIRS}
|
||||
|
|
|
@ -774,7 +774,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
|
|||
part->clength = 1.0f;
|
||||
}
|
||||
|
||||
/* set old pointcaches to have disk cache flag */
|
||||
/* Set old point-caches to have disk cache flag. */
|
||||
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -3639,7 +3639,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
|
||||
LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
|
||||
arm->flag &= ~(ARM_FLAG_UNUSED_1 | ARM_FLAG_UNUSED_5 | ARM_FLAG_UNUSED_6 |
|
||||
arm->flag &= ~(ARM_FLAG_UNUSED_1 | ARM_DRAW_RELATION_FROM_HEAD | ARM_FLAG_UNUSED_6 |
|
||||
ARM_FLAG_UNUSED_7 | ARM_FLAG_UNUSED_12);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,10 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_material_empty_base_volume)
|
|||
|
||||
/**** MATERIAL VERTEX SHADER PERMUTATIONS ****/
|
||||
|
||||
/** -- Volumetric -- **/
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Volumetric
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_material_volumetric_vert)
|
||||
.additional_info("eevee_legacy_material_empty_base_volume")
|
||||
.vertex_out(legacy_volume_vert_geom_iface)
|
||||
|
@ -45,7 +48,12 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_material_volumetric_vert_no_geom)
|
|||
.additional_info("draw_resource_id_varying");
|
||||
#endif
|
||||
|
||||
/** -- World Shader -- **/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name World Shader
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_material_world_vert)
|
||||
.additional_info("eevee_legacy_material_empty_base")
|
||||
.additional_info("eevee_legacy_common_utiltex_lib")
|
||||
|
@ -54,7 +62,12 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_material_world_vert)
|
|||
.additional_info("draw_resource_id_varying")
|
||||
.vertex_in(0, Type::VEC2, "pos");
|
||||
|
||||
/** -- Surface Shader -- **/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Surface Shader
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_material_surface_vert_common)
|
||||
.additional_info("eevee_legacy_material_empty_base")
|
||||
.additional_info("draw_resource_id_varying")
|
||||
|
@ -81,7 +94,13 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_mateiral_surface_vert_pointcloud)
|
|||
.auto_resource_location(true);
|
||||
|
||||
/**** MATERIAL GEOMETRY SHADER PERMUTATIONS ****/
|
||||
/** -- Volumetric -- **/
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Volumetric
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_material_volumetric_geom)
|
||||
.additional_info("eevee_legacy_common_lib")
|
||||
.additional_info("draw_view")
|
||||
|
@ -89,9 +108,14 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_material_volumetric_geom)
|
|||
.geometry_layout(PrimitiveIn::TRIANGLES, PrimitiveOut::TRIANGLE_STRIP, 3)
|
||||
.additional_info("draw_resource_id_varying");
|
||||
|
||||
/** \} */
|
||||
|
||||
/**** MATERIAL FRAGMENT SHADER PERMUTATIONS ****/
|
||||
|
||||
/** -- Volumetric Shader -- **/
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Volumetric Shader
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_material_volumetric_frag)
|
||||
.additional_info("eevee_legacy_common_lib")
|
||||
.additional_info("draw_view")
|
||||
|
@ -102,7 +126,11 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_material_volumetric_frag)
|
|||
.fragment_out(2, Type::VEC4, "volumeEmissive")
|
||||
.fragment_out(3, Type::VEC4, "volumePhase");
|
||||
|
||||
/** -- Prepass Shader -- **/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Pre-pass Shader
|
||||
* \{ */
|
||||
|
||||
/* Common info for all `prepass_frag` variants. */
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_material_prepass_frag_common)
|
||||
|
@ -148,7 +176,11 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_material_prepass_frag_alpha_hash_pointcloud)
|
|||
.additional_info("eevee_legacy_material_prepass_frag_alpha_hash_common")
|
||||
.additional_info("draw_pointcloud");
|
||||
|
||||
/** -- Surface Shader -- **/
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Surface Shader
|
||||
* \{ */
|
||||
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_material_surface_frag_common)
|
||||
.additional_info("eevee_legacy_common_lib")
|
||||
|
@ -173,6 +205,8 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_material_surface_frag_alpha_blend)
|
|||
.fragment_out(0, Type::VEC4, "outRadiance", DualBlend::SRC_0)
|
||||
.fragment_out(0, Type::VEC4, "outTransmittance", DualBlend::SRC_1);
|
||||
|
||||
/** \} */
|
||||
|
||||
/* hair_refine_shader_transform_feedback_create */
|
||||
|
||||
GPU_SHADER_INTERFACE_INFO(legacy_hair_refine_shader_transform_feedback_iface, "")
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
#define GBUF_COLOR_SLOT RBUFS_DIFF_COLOR_SLOT
|
||||
|
||||
/* Uniform Buffers. */
|
||||
/* Only during prepass. */
|
||||
/* Only during pre-pass. */
|
||||
#define VELOCITY_CAMERA_PREV_BUF 3
|
||||
#define VELOCITY_CAMERA_CURR_BUF 4
|
||||
#define VELOCITY_CAMERA_NEXT_BUF 5
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* -------------------------------------------------------------------- */
|
||||
/** \name Surface Velocity
|
||||
*
|
||||
* Combined with the depth prepass shader.
|
||||
* Combined with the depth pre-pass shader.
|
||||
* Outputs the view motion vectors for animated objects.
|
||||
* \{ */
|
||||
|
||||
|
|
|
@ -2023,6 +2023,20 @@ static void pchan_draw_ik_lines(ArmatureDrawContext *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
static void draw_bone_bone_relationship_line(ArmatureDrawContext *ctx,
|
||||
const float bone_head[3],
|
||||
const float parent_head[3],
|
||||
const float parent_tail[3],
|
||||
const eArmature_Flag armature_flags)
|
||||
{
|
||||
if (armature_flags & ARM_DRAW_RELATION_FROM_HEAD) {
|
||||
drw_shgroup_bone_relationship_lines(ctx, bone_head, parent_head);
|
||||
}
|
||||
else {
|
||||
drw_shgroup_bone_relationship_lines(ctx, bone_head, parent_tail);
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_bone_relations(ArmatureDrawContext *ctx,
|
||||
EditBone *ebone,
|
||||
bPoseChannel *pchan,
|
||||
|
@ -2036,7 +2050,8 @@ static void draw_bone_relations(ArmatureDrawContext *ctx,
|
|||
* since riggers will want to know about the links between bones
|
||||
*/
|
||||
if ((boneflag & BONE_CONNECTED) == 0) {
|
||||
drw_shgroup_bone_relationship_lines(ctx, ebone->head, ebone->parent->tail);
|
||||
draw_bone_bone_relationship_line(
|
||||
ctx, ebone->head, ebone->parent->head, ebone->parent->tail, eArmature_Flag(arm->flag));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2047,7 +2062,11 @@ static void draw_bone_relations(ArmatureDrawContext *ctx,
|
|||
if ((boneflag & BONE_SELECTED) ||
|
||||
(pchan->parent->bone && (pchan->parent->bone->flag & BONE_SELECTED))) {
|
||||
if ((boneflag & BONE_CONNECTED) == 0) {
|
||||
drw_shgroup_bone_relationship_lines(ctx, pchan->pose_head, pchan->parent->pose_tail);
|
||||
draw_bone_bone_relationship_line(ctx,
|
||||
pchan->pose_head,
|
||||
pchan->parent->pose_head,
|
||||
pchan->parent->pose_tail,
|
||||
eArmature_Flag(arm->flag));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1165,7 +1165,7 @@ OVERLAY_InstanceFormats *OVERLAY_shader_instance_formats_get(void)
|
|||
{
|
||||
{"boneStart", DRW_ATTR_FLOAT, 3},
|
||||
{"boneEnd", DRW_ATTR_FLOAT, 3},
|
||||
{"wireColor", DRW_ATTR_FLOAT, 4}, /* TODO: uchar color. */
|
||||
{"wireColor", DRW_ATTR_FLOAT, 4}, /* TODO: `uchar` color. */
|
||||
{"boneColor", DRW_ATTR_FLOAT, 4},
|
||||
{"headColor", DRW_ATTR_FLOAT, 4},
|
||||
{"tailColor", DRW_ATTR_FLOAT, 4},
|
||||
|
|
|
@ -227,9 +227,9 @@ static void mesh_render_data_mat_tri_len_build_threaded(MeshRenderData *mr,
|
|||
}
|
||||
|
||||
/* Count how many triangles for each material. */
|
||||
static void mesh_render_data_mat_tri_len_build(MeshRenderData *mr,
|
||||
blender::MutableSpan<int> mat_tri_len)
|
||||
static blender::Array<int> mesh_render_data_mat_tri_len_build(MeshRenderData *mr)
|
||||
{
|
||||
blender::Array<int> mat_tri_len(mr->mat_len, 0);
|
||||
if (mr->extract_type == MR_EXTRACT_BMESH) {
|
||||
BMesh *bm = mr->bm;
|
||||
mesh_render_data_mat_tri_len_build_threaded(
|
||||
|
@ -239,15 +239,13 @@ static void mesh_render_data_mat_tri_len_build(MeshRenderData *mr,
|
|||
mesh_render_data_mat_tri_len_build_threaded(
|
||||
mr, mr->poly_len, mesh_render_data_mat_tri_len_mesh_range_fn, mat_tri_len);
|
||||
}
|
||||
return mat_tri_len;
|
||||
}
|
||||
|
||||
static void mesh_render_data_polys_sorted_build(MeshRenderData *mr, MeshBufferCache *cache)
|
||||
{
|
||||
using namespace blender;
|
||||
cache->poly_sorted.tri_first_index.reinitialize(mr->poly_len);
|
||||
cache->poly_sorted.mat_tri_len.reinitialize(mr->mat_len);
|
||||
|
||||
mesh_render_data_mat_tri_len_build(mr, cache->poly_sorted.mat_tri_len);
|
||||
cache->poly_sorted.mat_tri_len = mesh_render_data_mat_tri_len_build(mr);
|
||||
const Span<int> mat_tri_len = cache->poly_sorted.mat_tri_len;
|
||||
|
||||
/* Apply offset. */
|
||||
|
@ -261,6 +259,7 @@ static void mesh_render_data_polys_sorted_build(MeshRenderData *mr, MeshBufferCa
|
|||
}
|
||||
cache->poly_sorted.visible_tri_len = visible_tri_len;
|
||||
|
||||
cache->poly_sorted.tri_first_index.reinitialize(mr->poly_len);
|
||||
MutableSpan<int> tri_first_index = cache->poly_sorted.tri_first_index;
|
||||
|
||||
/* Sort per material. */
|
||||
|
|
|
@ -213,7 +213,7 @@ void ED_gpencil_strokes_copybuf_free(void);
|
|||
/* drawgpencil.c */
|
||||
|
||||
/**
|
||||
* Draw grease-pencil sketches to specified 2d-view that uses ibuf corrections.
|
||||
* Draw grease-pencil sketches to specified 2d-view that uses `ibuf` corrections.
|
||||
*/
|
||||
void ED_annotation_draw_2dimage(const struct bContext *C);
|
||||
/**
|
||||
|
|
|
@ -148,6 +148,7 @@ typedef enum eKeyframeIterFlags {
|
|||
* iterator callbacks then. */
|
||||
KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE = (1 << 3),
|
||||
} eKeyframeIterFlags;
|
||||
ENUM_OPERATORS(eKeyframeIterFlags, KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE)
|
||||
|
||||
/** \} */
|
||||
|
||||
|
|
|
@ -23,15 +23,15 @@ set(INC_SYS
|
|||
)
|
||||
|
||||
set(SRC
|
||||
action_buttons.c
|
||||
action_data.c
|
||||
action_draw.c
|
||||
action_edit.c
|
||||
action_ops.c
|
||||
action_select.c
|
||||
space_action.c
|
||||
action_buttons.cc
|
||||
action_data.cc
|
||||
action_draw.cc
|
||||
action_edit.cc
|
||||
action_ops.cc
|
||||
action_select.cc
|
||||
space_action.cc
|
||||
|
||||
action_intern.h
|
||||
action_intern.hh
|
||||
)
|
||||
|
||||
set(LIB
|
||||
|
|
|
@ -5,30 +5,30 @@
|
|||
* \ingroup spaction
|
||||
*/
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_screen.h"
|
||||
|
||||
#include "action_intern.h" /* own include */
|
||||
#include "action_intern.hh" /* own include */
|
||||
|
||||
/* ******************* action editor space & buttons ************** */
|
||||
|
||||
/* ******************* general ******************************** */
|
||||
|
||||
void action_buttons_register(ARegionType *UNUSED(art))
|
||||
void action_buttons_register(ARegionType * /*art*/)
|
||||
{
|
||||
#if 0
|
||||
PanelType *pt;
|
||||
|
||||
/* TODO: AnimData / Actions List */
|
||||
|
||||
pt = MEM_callocN(sizeof(PanelType), "spacetype action panel properties");
|
||||
pt = MEM_cnew<PanelType>("spacetype action panel properties");
|
||||
strcpy(pt->idname, "ACTION_PT_properties");
|
||||
strcpy(pt->label, N_("Active F-Curve"));
|
||||
strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
|
||||
|
@ -36,7 +36,7 @@ void action_buttons_register(ARegionType *UNUSED(art))
|
|||
pt->poll = action_anim_panel_poll;
|
||||
BLI_addtail(&art->paneltypes, pt);
|
||||
|
||||
pt = MEM_callocN(sizeof(PanelType), "spacetype action panel properties");
|
||||
pt = MEM_cnew<PanelType>("spacetype action panel properties");
|
||||
strcpy(pt->idname, "ACTION_PT_key_properties");
|
||||
strcpy(pt->label, N_("Active Keyframe"));
|
||||
strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
|
|
@ -5,10 +5,10 @@
|
|||
* \ingroup spaction
|
||||
*/
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
|||
|
||||
#include "UI_interface.h"
|
||||
|
||||
#include "action_intern.h"
|
||||
#include "action_intern.hh"
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Utilities
|
||||
|
@ -62,7 +62,7 @@ AnimData *ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owne
|
|||
{
|
||||
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
AnimData *adt = NULL;
|
||||
AnimData *adt = nullptr;
|
||||
|
||||
/* Get AnimData block to use */
|
||||
if (saction->mode == SACTCONT_ACTION) {
|
||||
|
@ -146,11 +146,11 @@ static void actedit_change_action(bContext *C, bAction *act)
|
|||
RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, saction, &ptr);
|
||||
prop = RNA_struct_find_property(&ptr, "action");
|
||||
|
||||
/* NOTE: act may be NULL here, so better to just use a cast here */
|
||||
/* NOTE: act may be nullptr here, so better to just use a cast here */
|
||||
RNA_id_pointer_create((ID *)act, &idptr);
|
||||
|
||||
/* set the new pointer, and force a refresh */
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, NULL);
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, nullptr);
|
||||
RNA_property_update(C, &ptr, prop);
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ static bool action_new_poll(bContext *C)
|
|||
if (saction->mode == SACTCONT_ACTION) {
|
||||
/* XXX: This assumes that actions are assigned to the active object in this mode */
|
||||
if (ob) {
|
||||
if ((ob->adt == NULL) || (ob->adt->flag & ADT_NLA_EDIT_ON) == 0) {
|
||||
if ((ob->adt == nullptr) || (ob->adt->flag & ADT_NLA_EDIT_ON) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ static bool action_new_poll(bContext *C)
|
|||
else if (saction->mode == SACTCONT_SHAPEKEY) {
|
||||
Key *key = BKE_key_from_object(ob);
|
||||
if (key) {
|
||||
if ((key->adt == NULL) || (key->adt->flag & ADT_NLA_EDIT_ON) == 0) {
|
||||
if ((key->adt == nullptr) || (key->adt->flag & ADT_NLA_EDIT_ON) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -205,14 +205,14 @@ static bool action_new_poll(bContext *C)
|
|||
return false;
|
||||
}
|
||||
|
||||
static int action_new_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int action_new_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
PointerRNA ptr, idptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
bAction *oldact = NULL;
|
||||
AnimData *adt = NULL;
|
||||
ID *adt_id_owner = NULL;
|
||||
bAction *oldact = nullptr;
|
||||
AnimData *adt = nullptr;
|
||||
ID *adt_id_owner = nullptr;
|
||||
/* hook into UI */
|
||||
UI_context_active_but_prop_get_templateID(C, &ptr, &prop);
|
||||
|
||||
|
@ -225,7 +225,7 @@ static int action_new_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
|
||||
/* stash the old action to prevent it from being lost */
|
||||
if (ptr.type == &RNA_AnimData) {
|
||||
adt = ptr.data;
|
||||
adt = static_cast<AnimData *>(ptr.data);
|
||||
adt_id_owner = ptr.owner_id;
|
||||
}
|
||||
else if (ptr.type == &RNA_SpaceDopeSheetEditor) {
|
||||
|
@ -237,11 +237,11 @@ static int action_new_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
oldact = adt->action;
|
||||
}
|
||||
{
|
||||
bAction *action = NULL;
|
||||
bAction *action = nullptr;
|
||||
|
||||
/* Perform stashing operation - But only if there is an action */
|
||||
if (adt && oldact) {
|
||||
BLI_assert(adt_id_owner != NULL);
|
||||
BLI_assert(adt_id_owner != nullptr);
|
||||
/* stash the action */
|
||||
if (BKE_nla_action_stash(adt, ID_IS_OVERRIDE_LIBRARY(adt_id_owner))) {
|
||||
/* The stash operation will remove the user already
|
||||
|
@ -252,8 +252,8 @@ static int action_new_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
* or else the user gets decremented twice!
|
||||
*/
|
||||
if (ptr.type == &RNA_SpaceDopeSheetEditor) {
|
||||
SpaceAction *saction = ptr.data;
|
||||
saction->action = NULL;
|
||||
SpaceAction *saction = static_cast<SpaceAction *>(ptr.data);
|
||||
saction->action = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -272,13 +272,13 @@ static int action_new_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
* NOTE: we can't use actedit_change_action, as this function is also called from the NLA
|
||||
*/
|
||||
RNA_id_pointer_create(&action->id, &idptr);
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, NULL);
|
||||
RNA_property_pointer_set(&ptr, prop, idptr, nullptr);
|
||||
RNA_property_update(C, &ptr, prop);
|
||||
}
|
||||
}
|
||||
|
||||
/* set notifier that keyframes have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_ADDED, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_ADDED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ static bool action_pushdown_poll(bContext *C)
|
|||
{
|
||||
if (ED_operator_action_active(C)) {
|
||||
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, NULL);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, nullptr);
|
||||
|
||||
/* Check for AnimData, Actions, and that tweak-mode is off. */
|
||||
if (adt && saction->action) {
|
||||
|
@ -333,7 +333,7 @@ static bool action_pushdown_poll(bContext *C)
|
|||
static int action_pushdown_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
|
||||
ID *adt_id_owner = NULL;
|
||||
ID *adt_id_owner = nullptr;
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, &adt_id_owner);
|
||||
|
||||
/* Do the deed... */
|
||||
|
@ -349,7 +349,7 @@ static int action_pushdown_exec(bContext *C, wmOperator *op)
|
|||
/* action can be safely added */
|
||||
BKE_nla_action_pushdown(adt, ID_IS_OVERRIDE_LIBRARY(adt_id_owner));
|
||||
|
||||
struct Main *bmain = CTX_data_main(C);
|
||||
Main *bmain = CTX_data_main(C);
|
||||
DEG_id_tag_update_ex(bmain, adt_id_owner, ID_RECALC_ANIMATION);
|
||||
|
||||
/* The action needs updating too, as FCurve modifiers are to be reevaluated. They won't extend
|
||||
|
@ -359,11 +359,11 @@ static int action_pushdown_exec(bContext *C, wmOperator *op)
|
|||
/* Stop displaying this action in this editor
|
||||
* NOTE: The editor itself doesn't set a user...
|
||||
*/
|
||||
saction->action = NULL;
|
||||
saction->action = nullptr;
|
||||
}
|
||||
|
||||
/* Send notifiers that stuff has changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, nullptr);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
@ -391,7 +391,7 @@ void ACTION_OT_push_down(wmOperatorType *ot)
|
|||
static int action_stash_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
|
||||
ID *adt_id_owner = NULL;
|
||||
ID *adt_id_owner = nullptr;
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, &adt_id_owner);
|
||||
|
||||
/* Perform stashing operation */
|
||||
|
@ -410,7 +410,7 @@ static int action_stash_exec(bContext *C, wmOperator *op)
|
|||
* the user-count fixes. Hence, we must unset this ref
|
||||
* first before setting the new action.
|
||||
*/
|
||||
saction->action = NULL;
|
||||
saction->action = nullptr;
|
||||
}
|
||||
else {
|
||||
/* action has already been added - simply warn about this, and clear */
|
||||
|
@ -418,11 +418,11 @@ static int action_stash_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
/* clear action refs from editor, and then also the backing data (not necessary) */
|
||||
actedit_change_action(C, NULL);
|
||||
actedit_change_action(C, nullptr);
|
||||
}
|
||||
|
||||
/* Send notifiers that stuff has changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, nullptr);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
@ -461,7 +461,7 @@ void ACTION_OT_stash(wmOperatorType *ot)
|
|||
static bool action_stash_create_poll(bContext *C)
|
||||
{
|
||||
if (ED_operator_action_active(C)) {
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, NULL);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, nullptr);
|
||||
|
||||
/* Check tweak-mode is off (as you don't want to be tampering with the action in that case) */
|
||||
/* NOTE: unlike for pushdown,
|
||||
|
@ -494,13 +494,13 @@ static bool action_stash_create_poll(bContext *C)
|
|||
static int action_stash_create_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
|
||||
ID *adt_id_owner = NULL;
|
||||
ID *adt_id_owner = nullptr;
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, &adt_id_owner);
|
||||
|
||||
/* Check for no action... */
|
||||
if (saction->action == NULL) {
|
||||
if (saction->action == nullptr) {
|
||||
/* just create a new action */
|
||||
bAction *action = action_create_new(C, NULL);
|
||||
bAction *action = action_create_new(C, nullptr);
|
||||
actedit_change_action(C, action);
|
||||
}
|
||||
else if (adt) {
|
||||
|
@ -513,29 +513,29 @@ static int action_stash_create_exec(bContext *C, wmOperator *op)
|
|||
|
||||
/* stash the action */
|
||||
if (BKE_nla_action_stash(adt, ID_IS_OVERRIDE_LIBRARY(adt_id_owner))) {
|
||||
bAction *new_action = NULL;
|
||||
bAction *new_action = nullptr;
|
||||
|
||||
/* Create new action not based on the old one
|
||||
* (since the "new" operator already does that). */
|
||||
new_action = action_create_new(C, NULL);
|
||||
new_action = action_create_new(C, nullptr);
|
||||
|
||||
/* The stash operation will remove the user already,
|
||||
* so the flushing step later shouldn't double up
|
||||
* the user-count fixes. Hence, we must unset this ref
|
||||
* first before setting the new action.
|
||||
*/
|
||||
saction->action = NULL;
|
||||
saction->action = nullptr;
|
||||
actedit_change_action(C, new_action);
|
||||
}
|
||||
else {
|
||||
/* action has already been added - simply warn about this, and clear */
|
||||
BKE_report(op->reports, RPT_ERROR, "Action has already been stashed");
|
||||
actedit_change_action(C, NULL);
|
||||
actedit_change_action(C, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Send notifiers that stuff has changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ACTCHANGE, nullptr);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
@ -598,19 +598,19 @@ void ED_animedit_unlink_action(
|
|||
NlaTrack *nlt, *nlt_next;
|
||||
NlaStrip *strip, *nstrip;
|
||||
|
||||
for (nlt = adt->nla_tracks.first; nlt; nlt = nlt_next) {
|
||||
for (nlt = static_cast<NlaTrack *>(adt->nla_tracks.first); nlt; nlt = nlt_next) {
|
||||
nlt_next = nlt->next;
|
||||
|
||||
if (strstr(nlt->name, DATA_("[Action Stash]"))) {
|
||||
for (strip = nlt->strips.first; strip; strip = nstrip) {
|
||||
for (strip = static_cast<NlaStrip *>(nlt->strips.first); strip; strip = nstrip) {
|
||||
nstrip = strip->next;
|
||||
|
||||
if (strip->act == act) {
|
||||
/* Remove this strip, and the track too if it doesn't have anything else */
|
||||
BKE_nlastrip_remove_and_free(&nlt->strips, strip, true);
|
||||
|
||||
if (nlt->strips.first == NULL) {
|
||||
BLI_assert(nstrip == NULL);
|
||||
if (nlt->strips.first == nullptr) {
|
||||
BLI_assert(nstrip == nullptr);
|
||||
BKE_nlatrack_remove_and_free(&adt->nla_tracks, nlt, true);
|
||||
}
|
||||
}
|
||||
|
@ -628,15 +628,15 @@ void ED_animedit_unlink_action(
|
|||
BKE_nla_tweakmode_exit(adt);
|
||||
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
if (scene != NULL) {
|
||||
if (scene != nullptr) {
|
||||
scene->flag &= ~SCE_NLA_EDIT_ON;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Unlink normally - Setting it to NULL should be enough to get the old one unlinked */
|
||||
/* Unlink normally - Setting it to nullptr should be enough to get the old one unlinked */
|
||||
if (area->spacetype == SPACE_ACTION) {
|
||||
/* clear action editor -> action */
|
||||
actedit_change_action(C, NULL);
|
||||
actedit_change_action(C, nullptr);
|
||||
}
|
||||
else {
|
||||
/* clear AnimData -> action */
|
||||
|
@ -648,7 +648,7 @@ void ED_animedit_unlink_action(
|
|||
prop = RNA_struct_find_property(&ptr, "action");
|
||||
|
||||
/* clear... */
|
||||
RNA_property_pointer_set(&ptr, prop, PointerRNA_NULL, NULL);
|
||||
RNA_property_pointer_set(&ptr, prop, PointerRNA_NULL, nullptr);
|
||||
RNA_property_update(C, &ptr, prop);
|
||||
}
|
||||
}
|
||||
|
@ -660,7 +660,7 @@ static bool action_unlink_poll(bContext *C)
|
|||
{
|
||||
if (ED_operator_action_active(C)) {
|
||||
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, NULL);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, nullptr);
|
||||
|
||||
/* Only when there's an active action, in the right modes... */
|
||||
if (saction->action && adt) {
|
||||
|
@ -674,15 +674,15 @@ static bool action_unlink_poll(bContext *C)
|
|||
|
||||
static int action_unlink_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, NULL);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, nullptr);
|
||||
bool force_delete = RNA_boolean_get(op->ptr, "force_delete");
|
||||
|
||||
if (adt && adt->action) {
|
||||
ED_animedit_unlink_action(C, NULL, adt, adt->action, op->reports, force_delete);
|
||||
ED_animedit_unlink_action(C, nullptr, adt, adt->action, op->reports, force_delete);
|
||||
}
|
||||
|
||||
/* Unlink is also abused to exit NLA tweak mode. */
|
||||
WM_main_add_notifier(NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
|
||||
WM_main_add_notifier(NC_ANIMATION | ND_NLA_ACTCHANGE, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -733,24 +733,24 @@ static NlaStrip *action_layer_get_nlastrip(ListBase *strips, float ctime)
|
|||
{
|
||||
NlaStrip *strip;
|
||||
|
||||
for (strip = strips->first; strip; strip = strip->next) {
|
||||
for (strip = static_cast<NlaStrip *>(strips->first); strip; strip = strip->next) {
|
||||
/* Can we use this? */
|
||||
if (IN_RANGE_INCL(ctime, strip->start, strip->end)) {
|
||||
/* in range - use this one */
|
||||
return strip;
|
||||
}
|
||||
if ((ctime < strip->start) && (strip->prev == NULL)) {
|
||||
if ((ctime < strip->start) && (strip->prev == nullptr)) {
|
||||
/* before first - use this one */
|
||||
return strip;
|
||||
}
|
||||
if ((ctime > strip->end) && (strip->next == NULL)) {
|
||||
if ((ctime > strip->end) && (strip->next == nullptr)) {
|
||||
/* after last - use this one */
|
||||
return strip;
|
||||
}
|
||||
}
|
||||
|
||||
/* nothing suitable found... */
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Switch NLA Strips/Actions. */
|
||||
|
@ -809,7 +809,7 @@ static bool action_layer_next_poll(bContext *C)
|
|||
{
|
||||
/* Action Editor's action editing modes only */
|
||||
if (ED_operator_action_active(C)) {
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, NULL);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, nullptr);
|
||||
if (adt) {
|
||||
/* only allow if we're in tweak-mode, and there's something above us... */
|
||||
if (adt->flag & ADT_NLA_EDIT_ON) {
|
||||
|
@ -829,7 +829,7 @@ static bool action_layer_next_poll(bContext *C)
|
|||
* to "move to an empty layer", even though this means
|
||||
* that we won't actually have an action.
|
||||
*/
|
||||
// return (adt->tmpact != NULL);
|
||||
// return (adt->tmpact != nullptr);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -843,7 +843,7 @@ static bool action_layer_next_poll(bContext *C)
|
|||
|
||||
static int action_layer_next_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, NULL);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, nullptr);
|
||||
NlaTrack *act_track;
|
||||
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
@ -852,7 +852,7 @@ static int action_layer_next_exec(bContext *C, wmOperator *op)
|
|||
/* Get active track */
|
||||
act_track = BKE_nlatrack_find_tweaked(adt);
|
||||
|
||||
if (act_track == NULL) {
|
||||
if (act_track == nullptr) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Could not find current NLA Track");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
@ -924,7 +924,7 @@ static bool action_layer_prev_poll(bContext *C)
|
|||
{
|
||||
/* Action Editor's action editing modes only */
|
||||
if (ED_operator_action_active(C)) {
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, NULL);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, nullptr);
|
||||
if (adt) {
|
||||
if (adt->flag & ADT_NLA_EDIT_ON) {
|
||||
/* Tweak Mode: We need to check if there are any tracks below the active one
|
||||
|
@ -947,7 +947,7 @@ static bool action_layer_prev_poll(bContext *C)
|
|||
}
|
||||
else {
|
||||
/* Normal Mode: If there are any tracks, we can try moving to those */
|
||||
return (adt->nla_tracks.first != NULL);
|
||||
return (adt->nla_tracks.first != nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -958,7 +958,7 @@ static bool action_layer_prev_poll(bContext *C)
|
|||
|
||||
static int action_layer_prev_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, NULL);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, nullptr);
|
||||
NlaTrack *act_track;
|
||||
NlaTrack *nlt;
|
||||
|
||||
|
@ -966,7 +966,7 @@ static int action_layer_prev_exec(bContext *C, wmOperator *op)
|
|||
float ctime = BKE_scene_ctime_get(scene);
|
||||
|
||||
/* Sanity Check */
|
||||
if (adt == NULL) {
|
||||
if (adt == nullptr) {
|
||||
BKE_report(
|
||||
op->reports, RPT_ERROR, "Internal Error: Could not find Animation Data/NLA Stack to use");
|
||||
return OPERATOR_CANCELLED;
|
||||
|
@ -982,7 +982,7 @@ static int action_layer_prev_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
else {
|
||||
/* Active Action - Use the top-most track */
|
||||
nlt = adt->nla_tracks.last;
|
||||
nlt = static_cast<NlaTrack *>(adt->nla_tracks.last);
|
||||
}
|
||||
|
||||
/* Find previous action and hook it up */
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
/* System includes ----------------------------------------------------- */
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_math.h"
|
||||
|
@ -42,7 +42,7 @@
|
|||
#include "ED_anim_api.h"
|
||||
#include "ED_keyframes_draw.h"
|
||||
|
||||
#include "action_intern.h"
|
||||
#include "action_intern.hh"
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Channel List
|
||||
|
@ -50,23 +50,23 @@
|
|||
|
||||
void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
View2D *v2d = ®ion->v2d;
|
||||
size_t items;
|
||||
|
||||
/* build list of channels to draw */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
|
||||
items = ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
items = ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
const int height = ANIM_UI_get_channels_total_height(v2d, items);
|
||||
const float pad_bottom = BLI_listbase_is_empty(ac->markers) ? 0 : UI_MARKER_MARGIN_Y;
|
||||
v2d->tot.ymin = -(height + pad_bottom);
|
||||
|
||||
/* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */
|
||||
UI_view2d_sync(NULL, ac->area, v2d, V2D_LOCK_COPY);
|
||||
UI_view2d_sync(nullptr, ac->area, v2d, V2D_LOCK_COPY);
|
||||
|
||||
const float channel_step = ANIM_UI_get_channel_step();
|
||||
/* Loop through channels, and set up drawing depending on their type. */
|
||||
|
@ -74,7 +74,8 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
|
|||
size_t channel_index = 0;
|
||||
float ymax = ANIM_UI_get_first_channel_top(v2d);
|
||||
|
||||
for (ale = anim_data.first; ale; ale = ale->next, ymax -= channel_step, channel_index++) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale;
|
||||
ale = ale->next, ymax -= channel_step, channel_index++) {
|
||||
const float ymin = ymax - ANIM_UI_get_channel_height();
|
||||
|
||||
/* check if visible */
|
||||
|
@ -90,7 +91,8 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
|
|||
size_t channel_index = 0;
|
||||
float ymax = ANIM_UI_get_first_channel_top(v2d);
|
||||
|
||||
for (ale = anim_data.first; ale; ale = ale->next, ymax -= channel_step, channel_index++) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale;
|
||||
ale = ale->next, ymax -= channel_step, channel_index++) {
|
||||
const float ymin = ymax - ANIM_UI_get_channel_height();
|
||||
|
||||
/* check if visible */
|
||||
|
@ -124,8 +126,8 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
|
|||
static void draw_channel_action_ranges(ListBase *anim_data, View2D *v2d)
|
||||
{
|
||||
/* Variables for coalescing the Y region of one action. */
|
||||
bAction *cur_action = NULL;
|
||||
AnimData *cur_adt = NULL;
|
||||
bAction *cur_action = nullptr;
|
||||
AnimData *cur_adt = nullptr;
|
||||
float cur_ymax;
|
||||
|
||||
/* Walk through channels, grouping contiguous spans referencing the same action. */
|
||||
|
@ -133,9 +135,10 @@ static void draw_channel_action_ranges(ListBase *anim_data, View2D *v2d)
|
|||
const float ystep = ANIM_UI_get_channel_step();
|
||||
float ymin = ymax - ystep;
|
||||
|
||||
for (bAnimListElem *ale = anim_data->first; ale; ale = ale->next, ymax = ymin, ymin -= ystep) {
|
||||
bAction *action = NULL;
|
||||
AnimData *adt = NULL;
|
||||
for (bAnimListElem *ale = static_cast<bAnimListElem *>(anim_data->first); ale;
|
||||
ale = ale->next, ymax = ymin, ymin -= ystep) {
|
||||
bAction *action = nullptr;
|
||||
AnimData *adt = nullptr;
|
||||
|
||||
/* check if visible */
|
||||
if (IN_RANGE(ymin, v2d->cur.ymin, v2d->cur.ymax) ||
|
||||
|
@ -170,12 +173,12 @@ static void draw_channel_action_ranges(ListBase *anim_data, View2D *v2d)
|
|||
|
||||
void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
|
||||
View2D *v2d = ®ion->v2d;
|
||||
bDopeSheet *ads = &saction->ads;
|
||||
AnimData *adt = NULL;
|
||||
AnimData *adt = nullptr;
|
||||
|
||||
uchar col1[4], col2[4];
|
||||
uchar col1a[4], col2a[4];
|
||||
|
@ -196,8 +199,10 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region
|
|||
UI_GetThemeColor4ubv(TH_DOPESHEET_CHANNELSUBOB, col2b);
|
||||
|
||||
/* build list of channels to draw */
|
||||
int filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
|
||||
size_t items = ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
eAnimFilter_Flags filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE |
|
||||
ANIMFILTER_LIST_CHANNELS);
|
||||
size_t items = ANIM_animdata_filter(
|
||||
ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
const int height = ANIM_UI_get_channels_total_height(v2d, items);
|
||||
const float pad_bottom = BLI_listbase_is_empty(ac->markers) ? 0 : UI_MARKER_MARGIN_Y;
|
||||
|
@ -220,7 +225,8 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region
|
|||
/* first backdrop strips */
|
||||
float ymax = ANIM_UI_get_first_channel_top(v2d);
|
||||
const float channel_step = ANIM_UI_get_channel_step();
|
||||
for (ale = anim_data.first; ale; ale = ale->next, ymax -= channel_step) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale;
|
||||
ale = ale->next, ymax -= channel_step) {
|
||||
const float ymin = ymax - ANIM_UI_get_channel_height();
|
||||
|
||||
/* check if visible */
|
||||
|
@ -255,7 +261,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region
|
|||
break;
|
||||
}
|
||||
case ANIMTYPE_GROUP: {
|
||||
bActionGroup *agrp = ale->data;
|
||||
bActionGroup *agrp = static_cast<bActionGroup *>(ale->data);
|
||||
if (show_group_colors && agrp->customCol) {
|
||||
if (sel) {
|
||||
immUniformColor3ubvAlpha((uchar *)agrp->cs.select, col1a[3]);
|
||||
|
@ -270,7 +276,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region
|
|||
break;
|
||||
}
|
||||
case ANIMTYPE_FCURVE: {
|
||||
FCurve *fcu = ale->data;
|
||||
FCurve *fcu = static_cast<FCurve *>(ale->data);
|
||||
if (show_group_colors && fcu->grp && fcu->grp->customCol) {
|
||||
immUniformColor3ubvAlpha((uchar *)fcu->grp->cs.active, sel ? col1[3] : col2[3]);
|
||||
}
|
||||
|
@ -375,11 +381,12 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region
|
|||
|
||||
ymax = ANIM_UI_get_first_channel_top(v2d);
|
||||
|
||||
struct AnimKeylistDrawList *draw_list = ED_keylist_draw_list_create();
|
||||
AnimKeylistDrawList *draw_list = ED_keylist_draw_list_create();
|
||||
|
||||
const float scale_factor = ANIM_UI_get_keyframe_scale_factor();
|
||||
|
||||
for (ale = anim_data.first; ale; ale = ale->next, ymax -= channel_step) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale;
|
||||
ale = ale->next, ymax -= channel_step) {
|
||||
const float ymin = ymax - ANIM_UI_get_channel_height();
|
||||
float ycenter = (ymin + ymax) / 2.0f;
|
||||
|
||||
|
@ -393,28 +400,67 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region
|
|||
/* draw 'keyframes' for each specific datatype */
|
||||
switch (ale->datatype) {
|
||||
case ALE_ALL:
|
||||
draw_summary_channel(draw_list, ale->data, ycenter, scale_factor, action_flag);
|
||||
draw_summary_channel(draw_list,
|
||||
static_cast<bAnimContext *>(ale->data),
|
||||
ycenter,
|
||||
scale_factor,
|
||||
action_flag);
|
||||
break;
|
||||
case ALE_SCE:
|
||||
draw_scene_channel(draw_list, ads, ale->key_data, ycenter, scale_factor, action_flag);
|
||||
draw_scene_channel(draw_list,
|
||||
ads,
|
||||
static_cast<Scene *>(ale->key_data),
|
||||
ycenter,
|
||||
scale_factor,
|
||||
action_flag);
|
||||
break;
|
||||
case ALE_OB:
|
||||
draw_object_channel(draw_list, ads, ale->key_data, ycenter, scale_factor, action_flag);
|
||||
draw_object_channel(draw_list,
|
||||
ads,
|
||||
static_cast<Object *>(ale->key_data),
|
||||
ycenter,
|
||||
scale_factor,
|
||||
action_flag);
|
||||
break;
|
||||
case ALE_ACT:
|
||||
draw_action_channel(draw_list, adt, ale->key_data, ycenter, scale_factor, action_flag);
|
||||
draw_action_channel(draw_list,
|
||||
adt,
|
||||
static_cast<bAction *>(ale->key_data),
|
||||
ycenter,
|
||||
scale_factor,
|
||||
action_flag);
|
||||
break;
|
||||
case ALE_GROUP:
|
||||
draw_agroup_channel(draw_list, adt, ale->data, ycenter, scale_factor, action_flag);
|
||||
draw_agroup_channel(draw_list,
|
||||
adt,
|
||||
static_cast<bActionGroup *>(ale->data),
|
||||
ycenter,
|
||||
scale_factor,
|
||||
action_flag);
|
||||
break;
|
||||
case ALE_FCURVE:
|
||||
draw_fcurve_channel(draw_list, adt, ale->key_data, ycenter, scale_factor, action_flag);
|
||||
draw_fcurve_channel(draw_list,
|
||||
adt,
|
||||
static_cast<FCurve *>(ale->key_data),
|
||||
ycenter,
|
||||
scale_factor,
|
||||
action_flag);
|
||||
break;
|
||||
case ALE_GPFRAME:
|
||||
draw_gpl_channel(draw_list, ads, ale->data, ycenter, scale_factor, action_flag);
|
||||
draw_gpl_channel(draw_list,
|
||||
ads,
|
||||
static_cast<bGPDlayer *>(ale->data),
|
||||
ycenter,
|
||||
scale_factor,
|
||||
action_flag);
|
||||
break;
|
||||
case ALE_MASKLAY:
|
||||
draw_masklay_channel(draw_list, ads, ale->data, ycenter, scale_factor, action_flag);
|
||||
draw_masklay_channel(draw_list,
|
||||
ads,
|
||||
static_cast<MaskLayer *>(ale->data),
|
||||
ycenter,
|
||||
scale_factor,
|
||||
action_flag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -630,7 +676,7 @@ static void timeline_cache_draw_single(PTCacheID *pid, float y_offset, float hei
|
|||
|
||||
void timeline_draw_cache(SpaceAction *saction, Object *ob, Scene *scene)
|
||||
{
|
||||
if ((saction->cache_display & TIME_CACHE_DISPLAY) == 0 || ob == NULL) {
|
||||
if ((saction->cache_display & TIME_CACHE_DISPLAY) == 0 || ob == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -643,7 +689,7 @@ void timeline_draw_cache(SpaceAction *saction, Object *ob, Scene *scene)
|
|||
|
||||
GPU_blend(GPU_BLEND_ALPHA);
|
||||
|
||||
/* Iterate over pointcaches on the active object, and draw each one's range. */
|
||||
/* Iterate over point-caches on the active object, and draw each one's range. */
|
||||
float y_offset = 0.0f;
|
||||
const float cache_draw_height = 4.0f * UI_SCALE_FAC * U.pixelsize;
|
||||
LISTBASE_FOREACH (PTCacheID *, pid, &pidlist) {
|
||||
|
@ -651,7 +697,7 @@ void timeline_draw_cache(SpaceAction *saction, Object *ob, Scene *scene)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (pid->cache->cached_frames == NULL) {
|
||||
if (pid->cache->cached_frames == nullptr) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -5,10 +5,10 @@
|
|||
* \ingroup spaction
|
||||
*/
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_math.h"
|
||||
|
@ -52,7 +52,7 @@
|
|||
|
||||
#include "UI_interface.h"
|
||||
|
||||
#include "action_intern.h"
|
||||
#include "action_intern.hh"
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Pose Markers: Localize Markers
|
||||
|
@ -69,7 +69,7 @@ static bool act_markers_make_local_poll(bContext *C)
|
|||
SpaceAction *sact = CTX_wm_space_action(C);
|
||||
|
||||
/* 1) */
|
||||
if (sact == NULL) {
|
||||
if (sact == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ static bool act_markers_make_local_poll(bContext *C)
|
|||
if (ELEM(sact->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (sact->action == NULL) {
|
||||
if (sact->action == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -87,25 +87,25 @@ static bool act_markers_make_local_poll(bContext *C)
|
|||
}
|
||||
|
||||
/* 4) */
|
||||
return ED_markers_get_first_selected(ED_context_get_markers(C)) != NULL;
|
||||
return ED_markers_get_first_selected(ED_context_get_markers(C)) != nullptr;
|
||||
}
|
||||
|
||||
static int act_markers_make_local_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int act_markers_make_local_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
ListBase *markers = ED_context_get_markers(C);
|
||||
|
||||
SpaceAction *sact = CTX_wm_space_action(C);
|
||||
bAction *act = (sact) ? sact->action : NULL;
|
||||
bAction *act = (sact) ? sact->action : nullptr;
|
||||
|
||||
TimeMarker *marker, *markern = NULL;
|
||||
TimeMarker *marker, *markern = nullptr;
|
||||
|
||||
/* sanity checks */
|
||||
if (ELEM(NULL, markers, act)) {
|
||||
if (ELEM(nullptr, markers, act)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
/* migrate markers */
|
||||
for (marker = markers->first; marker; marker = markern) {
|
||||
for (marker = static_cast<TimeMarker *>(markers->first); marker; marker = markern) {
|
||||
markern = marker->next;
|
||||
|
||||
/* move if marker is selected */
|
||||
|
@ -115,13 +115,13 @@ static int act_markers_make_local_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
}
|
||||
}
|
||||
|
||||
/* Now enable the "show posemarkers only" setting,
|
||||
* so that we can see that something did happen */
|
||||
/* Now enable the "show pose-markers only" setting,
|
||||
* so that we can see that something did happen. */
|
||||
sact->flag |= SACTION_POSEMARKERS_SHOW;
|
||||
|
||||
/* notifiers - both sets, as this change affects both */
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, nullptr);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -150,9 +150,9 @@ void ACTION_OT_markers_make_local(wmOperatorType *ot)
|
|||
/* Get the min/max keyframes. */
|
||||
static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const short onlySel)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
bool found = false;
|
||||
|
||||
/* get data to filter, from Action or Dopesheet */
|
||||
|
@ -160,7 +160,7 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const
|
|||
* Commented it, was breaking things (eg. the "auto preview range" tool). */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_SEL */ |
|
||||
ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* set large values to try to override */
|
||||
*min = 999999999.0f;
|
||||
|
@ -169,14 +169,14 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const
|
|||
/* check if any channels to set range with */
|
||||
if (anim_data.first) {
|
||||
/* go through channels, finding max extents */
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||
if (ale->datatype == ALE_GPFRAME) {
|
||||
bGPDlayer *gpl = ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
bGPDframe *gpf;
|
||||
|
||||
/* Find gp-frame which is less than or equal to current-frame. */
|
||||
for (gpf = gpl->frames.first; gpf; gpf = gpf->next) {
|
||||
for (gpf = static_cast<bGPDframe *>(gpl->frames.first); gpf; gpf = gpf->next) {
|
||||
if (!onlySel || (gpf->flag & GP_FRAME_SELECT)) {
|
||||
const float framenum = (float)gpf->framenum;
|
||||
*min = min_ff(*min, framenum);
|
||||
|
@ -186,11 +186,12 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const
|
|||
}
|
||||
}
|
||||
else if (ale->datatype == ALE_MASKLAY) {
|
||||
MaskLayer *masklay = ale->data;
|
||||
MaskLayer *masklay = static_cast<MaskLayer *>(ale->data);
|
||||
MaskLayerShape *masklay_shape;
|
||||
|
||||
/* Find mask layer which is less than or equal to current-frame. */
|
||||
for (masklay_shape = masklay->splines_shapes.first; masklay_shape;
|
||||
for (masklay_shape = static_cast<MaskLayerShape *>(masklay->splines_shapes.first);
|
||||
masklay_shape;
|
||||
masklay_shape = masklay_shape->next) {
|
||||
const float framenum = (float)masklay_shape->frame;
|
||||
*min = min_ff(*min, framenum);
|
||||
|
@ -248,7 +249,7 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const
|
|||
/** \name View: Automatic Preview-Range Operator
|
||||
* \{ */
|
||||
|
||||
static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int actkeys_previewrange_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
bAnimContext ac;
|
||||
Scene *scene;
|
||||
|
@ -258,7 +259,7 @@ static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
if (ANIM_animdata_get_context(C, &ac) == 0) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
if (ac.scene == NULL) {
|
||||
if (ac.scene == nullptr) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
|
@ -311,21 +312,22 @@ void ACTION_OT_previewrange_set(wmOperatorType *ot)
|
|||
*/
|
||||
static bool actkeys_channels_get_selected_extents(bAnimContext *ac, float *r_min, float *r_max)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
/* NOTE: not bool, since we want prioritize individual channels over expanders. */
|
||||
short found = 0;
|
||||
|
||||
/* get all items - we need to do it this way */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* loop through all channels, finding the first one that's selected */
|
||||
float ymax = ANIM_UI_get_first_channel_top(&ac->region->v2d);
|
||||
const float channel_step = ANIM_UI_get_channel_step();
|
||||
for (ale = anim_data.first; ale; ale = ale->next, ymax -= channel_step) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale;
|
||||
ale = ale->next, ymax -= channel_step) {
|
||||
const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
|
||||
|
||||
/* must be selected... */
|
||||
|
@ -374,7 +376,7 @@ static int actkeys_viewall(bContext *C, const bool only_sel)
|
|||
}
|
||||
|
||||
if (fabsf(max - min) < 1.0f) {
|
||||
/* Exception - center the single keyfrme */
|
||||
/* Exception - center the single keyframe. */
|
||||
float xwidth = BLI_rctf_size_x(&v2d->cur);
|
||||
|
||||
v2d->cur.xmin = min - xwidth / 2.0f;
|
||||
|
@ -407,7 +409,7 @@ static int actkeys_viewall(bContext *C, const bool only_sel)
|
|||
float ymid = (ymax - ymin) / 2.0f + ymin;
|
||||
float x_center;
|
||||
|
||||
UI_view2d_center_get(v2d, &x_center, NULL);
|
||||
UI_view2d_center_get(v2d, &x_center, nullptr);
|
||||
UI_view2d_center_set(v2d, x_center, ymid);
|
||||
}
|
||||
}
|
||||
|
@ -423,13 +425,13 @@ static int actkeys_viewall(bContext *C, const bool only_sel)
|
|||
|
||||
/* ......... */
|
||||
|
||||
static int actkeys_viewall_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int actkeys_viewall_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
/* whole range */
|
||||
return actkeys_viewall(C, false);
|
||||
}
|
||||
|
||||
static int actkeys_viewsel_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int actkeys_viewsel_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
/* only selected */
|
||||
return actkeys_viewall(C, true);
|
||||
|
@ -506,8 +508,9 @@ void ACTION_OT_view_frame(wmOperatorType *ot)
|
|||
|
||||
static short copy_action_keys(bAnimContext *ac)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
int filter, ok = 0;
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
eAnimFilter_Flags filter;
|
||||
short ok = 0;
|
||||
|
||||
/* clear buffer first */
|
||||
ANIM_fcurves_copybuf_free();
|
||||
|
@ -515,7 +518,7 @@ static short copy_action_keys(bAnimContext *ac)
|
|||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FCURVESONLY |
|
||||
ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* copy keyframes */
|
||||
ok = copy_animedit_keys(ac, &anim_data);
|
||||
|
@ -531,8 +534,8 @@ static eKeyPasteError paste_action_keys(bAnimContext *ac,
|
|||
const eKeyMergeMode merge_mode,
|
||||
bool flip)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
int filter;
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
/* filter data
|
||||
* - First time we try to filter more strictly, allowing only selected channels
|
||||
|
@ -543,8 +546,9 @@ static eKeyPasteError paste_action_keys(bAnimContext *ac,
|
|||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS);
|
||||
|
||||
if (ANIM_animdata_filter(ac, &anim_data, filter | ANIMFILTER_SEL, ac->data, ac->datatype) == 0) {
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
if (ANIM_animdata_filter(
|
||||
ac, &anim_data, filter | ANIMFILTER_SEL, ac->data, eAnimCont_Types(ac->datatype)) == 0) {
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
}
|
||||
|
||||
/* Value offset is always None because the user cannot see the effect of it. */
|
||||
|
@ -614,8 +618,8 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
|
|||
{
|
||||
bAnimContext ac;
|
||||
|
||||
const eKeyPasteOffset offset_mode = RNA_enum_get(op->ptr, "offset");
|
||||
const eKeyMergeMode merge_mode = RNA_enum_get(op->ptr, "merge");
|
||||
const eKeyPasteOffset offset_mode = eKeyPasteOffset(RNA_enum_get(op->ptr, "offset"));
|
||||
const eKeyMergeMode merge_mode = eKeyMergeMode(RNA_enum_get(op->ptr, "merge"));
|
||||
const bool flipped = RNA_boolean_get(op->ptr, "flipped");
|
||||
|
||||
bool gpframes_inbuf = false;
|
||||
|
@ -668,17 +672,15 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
|
|||
|
||||
/* Grease Pencil needs extra update to refresh the added keyframes. */
|
||||
if (ac.datatype == ANIMCONT_GPENCIL || gpframes_inbuf) {
|
||||
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, NULL);
|
||||
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, nullptr);
|
||||
}
|
||||
/* set notifier that keyframes have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static char *actkeys_paste_description(bContext *UNUSED(C),
|
||||
wmOperatorType *UNUSED(op),
|
||||
PointerRNA *ptr)
|
||||
static char *actkeys_paste_description(bContext * /*C*/, wmOperatorType * /*op*/, PointerRNA *ptr)
|
||||
{
|
||||
/* Custom description if the 'flipped' option is used. */
|
||||
if (RNA_boolean_get(ptr, "flipped")) {
|
||||
|
@ -686,7 +688,7 @@ static char *actkeys_paste_description(bContext *UNUSED(C),
|
|||
}
|
||||
|
||||
/* Use the default description in the other cases. */
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ACTION_OT_paste(wmOperatorType *ot)
|
||||
|
@ -738,7 +740,7 @@ static const EnumPropertyItem prop_actkeys_insertkey_types[] = {
|
|||
{2, "SEL", 0, "Only Selected Channels", ""},
|
||||
/* XXX not in all cases. */
|
||||
{3, "GROUP", 0, "In Active Group", ""},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static void insert_gpencil_key(bAnimContext *ac,
|
||||
|
@ -770,10 +772,10 @@ static void insert_fcurve_key(bAnimContext *ac,
|
|||
ToolSettings *ts = scene->toolsettings;
|
||||
|
||||
/* Read value from property the F-Curve represents, or from the curve only?
|
||||
* - ale->id != NULL:
|
||||
* - ale->id != nullptr:
|
||||
* Typically, this means that we have enough info to try resolving the path.
|
||||
*
|
||||
* - ale->owner != NULL:
|
||||
* - ale->owner != nullptr:
|
||||
* If this is set, then the path may not be resolvable from the ID alone,
|
||||
* so it's easier for now to just read the F-Curve directly.
|
||||
* (TODO: add the full-blown PointerRNA relative parsing case here...)
|
||||
|
@ -782,12 +784,12 @@ static void insert_fcurve_key(bAnimContext *ac,
|
|||
insert_keyframe(ac->bmain,
|
||||
reports,
|
||||
ale->id,
|
||||
NULL,
|
||||
((fcu->grp) ? (fcu->grp->name) : (NULL)),
|
||||
nullptr,
|
||||
((fcu->grp) ? (fcu->grp->name) : (nullptr)),
|
||||
fcu->rna_path,
|
||||
fcu->array_index,
|
||||
&anim_eval_context,
|
||||
ts->keyframe_type,
|
||||
eBezTriple_KeyframeType(ts->keyframe_type),
|
||||
nla_cache,
|
||||
flag);
|
||||
}
|
||||
|
@ -801,7 +803,8 @@ static void insert_fcurve_key(bAnimContext *ac,
|
|||
}
|
||||
|
||||
const float curval = evaluate_fcurve(fcu, cfra);
|
||||
insert_vert_fcurve(fcu, cfra, curval, ts->keyframe_type, 0);
|
||||
insert_vert_fcurve(
|
||||
fcu, cfra, curval, eBezTriple_KeyframeType(ts->keyframe_type), eInsertKeyFlags(0));
|
||||
}
|
||||
|
||||
ale->update |= ANIM_UPDATE_DEFAULT;
|
||||
|
@ -810,17 +813,17 @@ static void insert_fcurve_key(bAnimContext *ac,
|
|||
/* this function is responsible for inserting new keyframes */
|
||||
static void insert_action_keys(bAnimContext *ac, short mode)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase nla_cache = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
ListBase nla_cache = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
Scene *scene = ac->scene;
|
||||
ToolSettings *ts = scene->toolsettings;
|
||||
eInsertKeyFlags flag;
|
||||
|
||||
eGP_GetFrame_Mode add_frame_mode;
|
||||
bGPdata *gpd_old = NULL;
|
||||
bGPdata *gpd_old = nullptr;
|
||||
|
||||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
|
@ -832,7 +835,7 @@ static void insert_action_keys(bAnimContext *ac, short mode)
|
|||
filter |= ANIMFILTER_ACTGROUPED;
|
||||
}
|
||||
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* Init keyframing flag. */
|
||||
flag = ANIM_get_keyframing_flags(scene, true);
|
||||
|
@ -848,7 +851,7 @@ static void insert_action_keys(bAnimContext *ac, short mode)
|
|||
/* insert keyframes */
|
||||
const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
|
||||
ac->depsgraph, (float)scene->r.cfra);
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
switch (ale->type) {
|
||||
case ANIMTYPE_GPLAYER:
|
||||
insert_gpencil_key(ac, ale, add_frame_mode, &gpd_old);
|
||||
|
@ -894,9 +897,9 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op)
|
|||
|
||||
/* set notifier that keyframes have changed */
|
||||
if (ac.datatype == ANIMCONT_GPENCIL) {
|
||||
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, nullptr);
|
||||
}
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_ADDED, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_ADDED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -928,18 +931,18 @@ void ACTION_OT_keyframe_insert(wmOperatorType *ot)
|
|||
|
||||
static bool duplicate_action_keys(bAnimContext *ac)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
bool changed = false;
|
||||
|
||||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* loop through filtered data and delete selected keys */
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) {
|
||||
changed |= duplicate_fcurve_keys((FCurve *)ale->key_data);
|
||||
}
|
||||
|
@ -965,7 +968,7 @@ static bool duplicate_action_keys(bAnimContext *ac)
|
|||
|
||||
/* ------------------- */
|
||||
|
||||
static int actkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int actkeys_duplicate_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
bAnimContext ac;
|
||||
|
||||
|
@ -980,7 +983,7 @@ static int actkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
}
|
||||
|
||||
/* set notifier that keyframes have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_ADDED, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_ADDED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1008,18 +1011,18 @@ void ACTION_OT_duplicate(wmOperatorType *ot)
|
|||
|
||||
static bool delete_action_keys(bAnimContext *ac)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
bool changed_final = false;
|
||||
|
||||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* loop through filtered data and delete selected keys */
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
bool changed = false;
|
||||
|
||||
if (ale->type == ANIMTYPE_GPLAYER) {
|
||||
|
@ -1038,7 +1041,7 @@ static bool delete_action_keys(bAnimContext *ac)
|
|||
/* Only delete curve too if it won't be doing anything anymore */
|
||||
if (BKE_fcurve_is_empty(fcu)) {
|
||||
ANIM_fcurve_delete_from_animdata(ac, adt, fcu);
|
||||
ale->key_data = NULL;
|
||||
ale->key_data = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1056,7 +1059,7 @@ static bool delete_action_keys(bAnimContext *ac)
|
|||
|
||||
/* ------------------- */
|
||||
|
||||
static int actkeys_delete_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int actkeys_delete_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
bAnimContext ac;
|
||||
|
||||
|
@ -1071,7 +1074,7 @@ static int actkeys_delete_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
}
|
||||
|
||||
/* set notifier that keyframes have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_REMOVED, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_REMOVED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1101,17 +1104,17 @@ void ACTION_OT_delete(wmOperatorType *ot)
|
|||
|
||||
static void clean_action_keys(bAnimContext *ac, float thresh, bool clean_chan)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_SEL | ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* loop through filtered data and clean curves */
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
clean_fcurve(ac, ale, thresh, clean_chan);
|
||||
|
||||
ale->update |= ANIM_UPDATE_DEFAULT;
|
||||
|
@ -1147,7 +1150,7 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op)
|
|||
clean_action_keys(&ac, thresh, clean_chan);
|
||||
|
||||
/* set notifier that keyframes have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1182,17 +1185,17 @@ void ACTION_OT_clean(wmOperatorType *ot)
|
|||
/* Evaluates the curves between each selected keyframe on each frame, and keys the value. */
|
||||
static void sample_action_keys(bAnimContext *ac)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* Loop through filtered data and add keys between selected keyframes on every frame. */
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
sample_fcurve((FCurve *)ale->key_data);
|
||||
|
||||
ale->update |= ANIM_UPDATE_DEPS;
|
||||
|
@ -1222,7 +1225,7 @@ static int actkeys_sample_exec(bContext *C, wmOperator *op)
|
|||
sample_action_keys(&ac);
|
||||
|
||||
/* set notifier that keyframes have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1275,23 +1278,23 @@ static const EnumPropertyItem prop_actkeys_expo_types[] = {
|
|||
0,
|
||||
"Clear Cyclic (F-Modifier)",
|
||||
"Remove Cycles F-Modifier if not needed anymore"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* this function is responsible for setting extrapolation mode for keyframes */
|
||||
static void setexpo_action_keys(bAnimContext *ac, short mode)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_SEL | ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* loop through setting mode per F-Curve */
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
|
||||
if (mode >= 0) {
|
||||
|
@ -1311,9 +1314,9 @@ static void setexpo_action_keys(bAnimContext *ac, short mode)
|
|||
}
|
||||
else if (mode == CLEAR_CYCLIC_EXPO) {
|
||||
/* remove all the modifiers fitting this description */
|
||||
FModifier *fcm, *fcn = NULL;
|
||||
FModifier *fcm, *fcn = nullptr;
|
||||
|
||||
for (fcm = fcu->modifiers.first; fcm; fcm = fcn) {
|
||||
for (fcm = static_cast<FModifier *>(fcu->modifiers.first); fcm; fcm = fcn) {
|
||||
fcn = fcm->next;
|
||||
|
||||
if (fcm->type == FMODIFIER_TYPE_CYCLES) {
|
||||
|
@ -1354,7 +1357,7 @@ static int actkeys_expo_exec(bContext *C, wmOperator *op)
|
|||
setexpo_action_keys(&ac, mode);
|
||||
|
||||
/* set notifier that keyframe properties have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1410,7 +1413,7 @@ static int actkeys_ipo_exec(bContext *C, wmOperator *op)
|
|||
ANIM_editkeyframes_ipo(mode));
|
||||
|
||||
/* set notifier that keyframe properties have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1464,7 +1467,7 @@ static int actkeys_easing_exec(bContext *C, wmOperator *op)
|
|||
ANIM_editkeyframes_easing(mode));
|
||||
|
||||
/* set notifier that keyframe properties have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1499,9 +1502,9 @@ void ACTION_OT_easing_type(wmOperatorType *ot)
|
|||
/* this function is responsible for setting handle-type of selected keyframes */
|
||||
static void sethandles_action_keys(bAnimContext *ac, short mode)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
KeyframeEditFunc edit_cb = ANIM_editkeyframes_handles(mode);
|
||||
KeyframeEditFunc sel_cb = ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
|
||||
|
@ -1509,19 +1512,19 @@ static void sethandles_action_keys(bAnimContext *ac, short mode)
|
|||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* Loop through setting flags for handles
|
||||
* NOTE: we do not supply KeyframeEditData to the looper yet.
|
||||
* Currently that's not necessary here.
|
||||
*/
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
FCurve *fcu = (FCurve *)ale->key_data;
|
||||
|
||||
/* any selected keyframes for editing? */
|
||||
if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, sel_cb, NULL)) {
|
||||
if (ANIM_fcurve_keyframes_loop(nullptr, fcu, nullptr, sel_cb, nullptr)) {
|
||||
/* change type of selected handles */
|
||||
ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, edit_cb, BKE_fcurve_handles_recalc);
|
||||
ANIM_fcurve_keyframes_loop(nullptr, fcu, nullptr, edit_cb, BKE_fcurve_handles_recalc);
|
||||
|
||||
ale->update |= ANIM_UPDATE_DEFAULT;
|
||||
}
|
||||
|
@ -1555,7 +1558,7 @@ static int actkeys_handletype_exec(bContext *C, wmOperator *op)
|
|||
sethandles_action_keys(&ac, mode);
|
||||
|
||||
/* set notifier that keyframe properties have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1588,29 +1591,30 @@ void ACTION_OT_handle_type(wmOperatorType *ot)
|
|||
/* this function is responsible for setting keyframe type for keyframes */
|
||||
static void setkeytype_action_keys(bAnimContext *ac, short mode)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
KeyframeEditFunc set_cb = ANIM_editkeyframes_keytype(mode);
|
||||
|
||||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* Loop through setting BezTriple interpolation
|
||||
* NOTE: we do not supply KeyframeEditData to the looper yet.
|
||||
* Currently that's not necessary here.
|
||||
*/
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
switch (ale->type) {
|
||||
case ANIMTYPE_GPLAYER:
|
||||
ED_gpencil_layer_frames_keytype_set(ale->data, mode);
|
||||
ED_gpencil_layer_frames_keytype_set(static_cast<bGPDlayer *>(ale->data), mode);
|
||||
ale->update |= ANIM_UPDATE_DEPS;
|
||||
break;
|
||||
|
||||
case ANIMTYPE_FCURVE:
|
||||
ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, NULL);
|
||||
ANIM_fcurve_keyframes_loop(
|
||||
nullptr, static_cast<FCurve *>(ale->key_data), nullptr, set_cb, nullptr);
|
||||
ale->update |= ANIM_UPDATE_DEPS | ANIM_UPDATE_HANDLES;
|
||||
break;
|
||||
|
||||
|
@ -1647,7 +1651,7 @@ static int actkeys_keytype_exec(bContext *C, wmOperator *op)
|
|||
setkeytype_action_keys(&ac, mode);
|
||||
|
||||
/* set notifier that keyframe properties have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1688,13 +1692,13 @@ static bool actkeys_framejump_poll(bContext *C)
|
|||
}
|
||||
|
||||
/* snap current-frame indicator to 'average time' of selected keyframe */
|
||||
static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
static int actkeys_framejump_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
bAnimContext ac;
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
KeyframeEditData ked = {{NULL}};
|
||||
eAnimFilter_Flags filter;
|
||||
KeyframeEditData ked = {{nullptr}};
|
||||
|
||||
/* get editor data */
|
||||
if (ANIM_animdata_get_context(C, &ac) == 0) {
|
||||
|
@ -1704,15 +1708,15 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
/* init edit data */
|
||||
/* loop over action data, averaging values */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, eAnimCont_Types(ac.datatype));
|
||||
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
switch (ale->datatype) {
|
||||
case ALE_GPFRAME: {
|
||||
bGPDlayer *gpl = ale->data;
|
||||
bGPDlayer *gpl = static_cast<bGPDlayer *>(ale->data);
|
||||
bGPDframe *gpf;
|
||||
|
||||
for (gpf = gpl->frames.first; gpf; gpf = gpf->next) {
|
||||
for (gpf = static_cast<bGPDframe *>(gpl->frames.first); gpf; gpf = gpf->next) {
|
||||
/* only if selected */
|
||||
if (!(gpf->flag & GP_FRAME_SELECT)) {
|
||||
continue;
|
||||
|
@ -1728,13 +1732,14 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
|
||||
case ALE_FCURVE: {
|
||||
AnimData *adt = ANIM_nla_mapping_get(&ac, ale);
|
||||
FCurve *fcurve = static_cast<FCurve *>(ale->key_data);
|
||||
if (adt) {
|
||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
||||
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_calc_average, NULL);
|
||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1);
|
||||
ANIM_nla_mapping_apply_fcurve(adt, fcurve, 0, 1);
|
||||
ANIM_fcurve_keyframes_loop(&ked, fcurve, nullptr, bezt_calc_average, nullptr);
|
||||
ANIM_nla_mapping_apply_fcurve(adt, fcurve, 1, 1);
|
||||
}
|
||||
else {
|
||||
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, bezt_calc_average, NULL);
|
||||
ANIM_fcurve_keyframes_loop(&ked, fcurve, nullptr, bezt_calc_average, nullptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1803,17 +1808,17 @@ static const EnumPropertyItem prop_actkeys_snap_types[] = {
|
|||
0,
|
||||
"Selection to Nearest Marker",
|
||||
"Snap selected keyframes to the nearest marker"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* this function is responsible for snapping keyframes to frame-times */
|
||||
static void snap_action_keys(bAnimContext *ac, short mode)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
KeyframeEditData ked = {{NULL}};
|
||||
KeyframeEditData ked = {{nullptr}};
|
||||
KeyframeEditFunc edit_cb;
|
||||
|
||||
/* filter data */
|
||||
|
@ -1824,38 +1829,40 @@ static void snap_action_keys(bAnimContext *ac, short mode)
|
|||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_NODUPLIS);
|
||||
}
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* get beztriple editing callbacks */
|
||||
edit_cb = ANIM_editkeyframes_snap(mode);
|
||||
|
||||
ked.scene = ac->scene;
|
||||
if (mode == ACTKEYS_SNAP_NEAREST_MARKER) {
|
||||
ked.list.first = (ac->markers) ? ac->markers->first : NULL;
|
||||
ked.list.last = (ac->markers) ? ac->markers->last : NULL;
|
||||
ked.list.first = (ac->markers) ? ac->markers->first : nullptr;
|
||||
ked.list.last = (ac->markers) ? ac->markers->last : nullptr;
|
||||
}
|
||||
|
||||
/* snap keyframes */
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||
|
||||
if (ale->type == ANIMTYPE_GPLAYER) {
|
||||
ED_gpencil_layer_snap_frames(ale->data, ac->scene, mode);
|
||||
ED_gpencil_layer_snap_frames(static_cast<bGPDlayer *>(ale->data), ac->scene, mode);
|
||||
}
|
||||
else if (ale->type == ANIMTYPE_MASKLAYER) {
|
||||
ED_masklayer_snap_frames(ale->data, ac->scene, mode);
|
||||
ED_masklayer_snap_frames(static_cast<MaskLayer *>(ale->data), ac->scene, mode);
|
||||
}
|
||||
else if (adt) {
|
||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0);
|
||||
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, BKE_fcurve_handles_recalc);
|
||||
FCurve *fcurve = static_cast<FCurve *>(ale->key_data);
|
||||
ANIM_nla_mapping_apply_fcurve(adt, fcurve, 0, 0);
|
||||
ANIM_fcurve_keyframes_loop(&ked, fcurve, nullptr, edit_cb, BKE_fcurve_handles_recalc);
|
||||
BKE_fcurve_merge_duplicate_keys(
|
||||
ale->key_data, SELECT, false); /* only use handles in graph editor */
|
||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0);
|
||||
fcurve, SELECT, false); /* only use handles in graph editor */
|
||||
ANIM_nla_mapping_apply_fcurve(adt, fcurve, 1, 0);
|
||||
}
|
||||
else {
|
||||
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, BKE_fcurve_handles_recalc);
|
||||
FCurve *fcurve = static_cast<FCurve *>(ale->key_data);
|
||||
ANIM_fcurve_keyframes_loop(&ked, fcurve, nullptr, edit_cb, BKE_fcurve_handles_recalc);
|
||||
BKE_fcurve_merge_duplicate_keys(
|
||||
ale->key_data, SELECT, false); /* only use handles in graph editor */
|
||||
fcurve, SELECT, false); /* only use handles in graph editor */
|
||||
}
|
||||
|
||||
ale->update |= ANIM_UPDATE_DEFAULT;
|
||||
|
@ -1884,7 +1891,7 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op)
|
|||
snap_action_keys(&ac, mode);
|
||||
|
||||
/* set notifier that keyframes have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1931,17 +1938,17 @@ static const EnumPropertyItem prop_actkeys_mirror_types[] = {
|
|||
0,
|
||||
"By Times Over First Selected Marker",
|
||||
"Flip times of selected keyframes using the first selected marker as the reference point"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
/* this function is responsible for mirroring keyframes */
|
||||
static void mirror_action_keys(bAnimContext *ac, short mode)
|
||||
{
|
||||
ListBase anim_data = {NULL, NULL};
|
||||
ListBase anim_data = {nullptr, nullptr};
|
||||
bAnimListElem *ale;
|
||||
int filter;
|
||||
eAnimFilter_Flags filter;
|
||||
|
||||
KeyframeEditData ked = {{NULL}};
|
||||
KeyframeEditData ked = {{nullptr}};
|
||||
KeyframeEditFunc edit_cb;
|
||||
|
||||
/* get beztriple editing callbacks */
|
||||
|
@ -1965,25 +1972,27 @@ static void mirror_action_keys(bAnimContext *ac, short mode)
|
|||
/* filter data */
|
||||
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
|
||||
ANIMFILTER_NODUPLIS);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
|
||||
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
|
||||
|
||||
/* mirror keyframes */
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
for (ale = static_cast<bAnimListElem *>(anim_data.first); ale; ale = ale->next) {
|
||||
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||
|
||||
if (ale->type == ANIMTYPE_GPLAYER) {
|
||||
ED_gpencil_layer_mirror_frames(ale->data, ac->scene, mode);
|
||||
ED_gpencil_layer_mirror_frames(static_cast<bGPDlayer *>(ale->data), ac->scene, mode);
|
||||
}
|
||||
else if (ale->type == ANIMTYPE_MASKLAYER) {
|
||||
/* TODO */
|
||||
}
|
||||
else if (adt) {
|
||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0);
|
||||
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, BKE_fcurve_handles_recalc);
|
||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0);
|
||||
FCurve *fcurve = static_cast<FCurve *>(ale->key_data);
|
||||
ANIM_nla_mapping_apply_fcurve(adt, fcurve, 0, 0);
|
||||
ANIM_fcurve_keyframes_loop(&ked, fcurve, nullptr, edit_cb, BKE_fcurve_handles_recalc);
|
||||
ANIM_nla_mapping_apply_fcurve(adt, fcurve, 1, 0);
|
||||
}
|
||||
else {
|
||||
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, BKE_fcurve_handles_recalc);
|
||||
ANIM_fcurve_keyframes_loop(
|
||||
&ked, static_cast<FCurve *>(ale->key_data), nullptr, edit_cb, BKE_fcurve_handles_recalc);
|
||||
}
|
||||
|
||||
ale->update |= ANIM_UPDATE_DEFAULT;
|
||||
|
@ -2012,7 +2021,7 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op)
|
|||
mirror_action_keys(&ac, mode);
|
||||
|
||||
/* set notifier that keyframes have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
|
@ -1,135 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
* Copyright 2008 Blender Foundation. All rights reserved. */
|
||||
|
||||
/** \file
|
||||
* \ingroup spaction
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct ARegion;
|
||||
struct ARegionType;
|
||||
struct Object;
|
||||
struct Scene;
|
||||
struct SpaceAction;
|
||||
struct bAnimContext;
|
||||
struct bContext;
|
||||
struct wmOperatorType;
|
||||
|
||||
/* internal exports only */
|
||||
|
||||
/* **************************************** */
|
||||
/* space_action.c / action_buttons.c */
|
||||
|
||||
void action_buttons_register(struct ARegionType *art);
|
||||
|
||||
/* ***************************************** */
|
||||
/* action_draw.c */
|
||||
|
||||
/**
|
||||
* Left hand part.
|
||||
*/
|
||||
void draw_channel_names(struct bContext *C, struct bAnimContext *ac, struct ARegion *region);
|
||||
/**
|
||||
* Draw keyframes in each channel.
|
||||
*/
|
||||
void draw_channel_strips(struct bAnimContext *ac,
|
||||
struct SpaceAction *saction,
|
||||
struct ARegion *region);
|
||||
|
||||
void timeline_draw_cache(struct SpaceAction *saction, struct Object *ob, struct Scene *scene);
|
||||
|
||||
/* ***************************************** */
|
||||
/* action_select.c */
|
||||
|
||||
void ACTION_OT_select_all(struct wmOperatorType *ot);
|
||||
void ACTION_OT_select_box(struct wmOperatorType *ot);
|
||||
void ACTION_OT_select_lasso(struct wmOperatorType *ot);
|
||||
void ACTION_OT_select_circle(struct wmOperatorType *ot);
|
||||
void ACTION_OT_select_column(struct wmOperatorType *ot);
|
||||
void ACTION_OT_select_linked(struct wmOperatorType *ot);
|
||||
void ACTION_OT_select_more(struct wmOperatorType *ot);
|
||||
void ACTION_OT_select_less(struct wmOperatorType *ot);
|
||||
void ACTION_OT_select_leftright(struct wmOperatorType *ot);
|
||||
void ACTION_OT_clickselect(struct wmOperatorType *ot);
|
||||
|
||||
/* defines for left-right select tool */
|
||||
enum eActKeys_LeftRightSelect_Mode {
|
||||
ACTKEYS_LRSEL_TEST = 0,
|
||||
ACTKEYS_LRSEL_LEFT,
|
||||
ACTKEYS_LRSEL_RIGHT,
|
||||
};
|
||||
|
||||
/* defines for column-select mode */
|
||||
enum eActKeys_ColumnSelect_Mode {
|
||||
ACTKEYS_COLUMNSEL_KEYS = 0,
|
||||
ACTKEYS_COLUMNSEL_CFRA,
|
||||
ACTKEYS_COLUMNSEL_MARKERS_COLUMN,
|
||||
ACTKEYS_COLUMNSEL_MARKERS_BETWEEN,
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* action_edit.c */
|
||||
|
||||
void ACTION_OT_previewrange_set(struct wmOperatorType *ot);
|
||||
void ACTION_OT_view_all(struct wmOperatorType *ot);
|
||||
void ACTION_OT_view_selected(struct wmOperatorType *ot);
|
||||
void ACTION_OT_view_frame(struct wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_copy(struct wmOperatorType *ot);
|
||||
void ACTION_OT_paste(struct wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_keyframe_insert(struct wmOperatorType *ot);
|
||||
void ACTION_OT_duplicate(struct wmOperatorType *ot);
|
||||
void ACTION_OT_delete(struct wmOperatorType *ot);
|
||||
void ACTION_OT_clean(struct wmOperatorType *ot);
|
||||
void ACTION_OT_sample(struct wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_keyframe_type(struct wmOperatorType *ot);
|
||||
void ACTION_OT_handle_type(struct wmOperatorType *ot);
|
||||
void ACTION_OT_interpolation_type(struct wmOperatorType *ot);
|
||||
void ACTION_OT_extrapolation_type(struct wmOperatorType *ot);
|
||||
void ACTION_OT_easing_type(struct wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_frame_jump(struct wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_snap(struct wmOperatorType *ot);
|
||||
void ACTION_OT_mirror(struct wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_new(struct wmOperatorType *ot);
|
||||
void ACTION_OT_unlink(struct wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_push_down(struct wmOperatorType *ot);
|
||||
void ACTION_OT_stash(struct wmOperatorType *ot);
|
||||
void ACTION_OT_stash_and_create(struct wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_layer_next(struct wmOperatorType *ot);
|
||||
void ACTION_OT_layer_prev(struct wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_markers_make_local(struct wmOperatorType *ot);
|
||||
|
||||
/* defines for snap keyframes
|
||||
* NOTE: keep in sync with eEditKeyframes_Snap (in ED_keyframes_edit.h)
|
||||
*/
|
||||
enum eActKeys_Snap_Mode {
|
||||
ACTKEYS_SNAP_CFRA = 1,
|
||||
ACTKEYS_SNAP_NEAREST_FRAME,
|
||||
ACTKEYS_SNAP_NEAREST_SECOND,
|
||||
ACTKEYS_SNAP_NEAREST_MARKER,
|
||||
};
|
||||
|
||||
/* defines for mirror keyframes
|
||||
* NOTE: keep in sync with eEditKeyframes_Mirror (in ED_keyframes_edit.h)
|
||||
*/
|
||||
enum eActKeys_Mirror_Mode {
|
||||
ACTKEYS_MIRROR_CFRA = 1,
|
||||
ACTKEYS_MIRROR_YAXIS,
|
||||
ACTKEYS_MIRROR_XAXIS,
|
||||
ACTKEYS_MIRROR_MARKER,
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* action_ops.c */
|
||||
|
||||
void action_operatortypes(void);
|
||||
void action_keymap(struct wmKeyConfig *keyconf);
|
|
@ -0,0 +1,133 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
* Copyright 2008 Blender Foundation. All rights reserved. */
|
||||
|
||||
/** \file
|
||||
* \ingroup spaction
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct ARegion;
|
||||
struct ARegionType;
|
||||
struct Object;
|
||||
struct Scene;
|
||||
struct SpaceAction;
|
||||
struct bAnimContext;
|
||||
struct bContext;
|
||||
struct wmOperatorType;
|
||||
|
||||
/* internal exports only */
|
||||
|
||||
/* **************************************** */
|
||||
/* space_action.c / action_buttons.c */
|
||||
|
||||
void action_buttons_register(ARegionType *art);
|
||||
|
||||
/* ***************************************** */
|
||||
/* action_draw.c */
|
||||
|
||||
/**
|
||||
* Left hand part.
|
||||
*/
|
||||
void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region);
|
||||
/**
|
||||
* Draw keyframes in each channel.
|
||||
*/
|
||||
void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region);
|
||||
|
||||
void timeline_draw_cache(SpaceAction *saction, Object *ob, Scene *scene);
|
||||
|
||||
/* ***************************************** */
|
||||
/* action_select.c */
|
||||
|
||||
void ACTION_OT_select_all(wmOperatorType *ot);
|
||||
void ACTION_OT_select_box(wmOperatorType *ot);
|
||||
void ACTION_OT_select_lasso(wmOperatorType *ot);
|
||||
void ACTION_OT_select_circle(wmOperatorType *ot);
|
||||
void ACTION_OT_select_column(wmOperatorType *ot);
|
||||
void ACTION_OT_select_linked(wmOperatorType *ot);
|
||||
void ACTION_OT_select_more(wmOperatorType *ot);
|
||||
void ACTION_OT_select_less(wmOperatorType *ot);
|
||||
void ACTION_OT_select_leftright(wmOperatorType *ot);
|
||||
void ACTION_OT_clickselect(wmOperatorType *ot);
|
||||
|
||||
/* defines for left-right select tool */
|
||||
enum eActKeys_LeftRightSelect_Mode {
|
||||
ACTKEYS_LRSEL_TEST = 0,
|
||||
ACTKEYS_LRSEL_LEFT,
|
||||
ACTKEYS_LRSEL_RIGHT,
|
||||
};
|
||||
|
||||
/* defines for column-select mode */
|
||||
enum eActKeys_ColumnSelect_Mode {
|
||||
ACTKEYS_COLUMNSEL_KEYS = 0,
|
||||
ACTKEYS_COLUMNSEL_CFRA,
|
||||
ACTKEYS_COLUMNSEL_MARKERS_COLUMN,
|
||||
ACTKEYS_COLUMNSEL_MARKERS_BETWEEN,
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* action_edit.c */
|
||||
|
||||
void ACTION_OT_previewrange_set(wmOperatorType *ot);
|
||||
void ACTION_OT_view_all(wmOperatorType *ot);
|
||||
void ACTION_OT_view_selected(wmOperatorType *ot);
|
||||
void ACTION_OT_view_frame(wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_copy(wmOperatorType *ot);
|
||||
void ACTION_OT_paste(wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_keyframe_insert(wmOperatorType *ot);
|
||||
void ACTION_OT_duplicate(wmOperatorType *ot);
|
||||
void ACTION_OT_delete(wmOperatorType *ot);
|
||||
void ACTION_OT_clean(wmOperatorType *ot);
|
||||
void ACTION_OT_sample(wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_keyframe_type(wmOperatorType *ot);
|
||||
void ACTION_OT_handle_type(wmOperatorType *ot);
|
||||
void ACTION_OT_interpolation_type(wmOperatorType *ot);
|
||||
void ACTION_OT_extrapolation_type(wmOperatorType *ot);
|
||||
void ACTION_OT_easing_type(wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_frame_jump(wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_snap(wmOperatorType *ot);
|
||||
void ACTION_OT_mirror(wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_new(wmOperatorType *ot);
|
||||
void ACTION_OT_unlink(wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_push_down(wmOperatorType *ot);
|
||||
void ACTION_OT_stash(wmOperatorType *ot);
|
||||
void ACTION_OT_stash_and_create(wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_layer_next(wmOperatorType *ot);
|
||||
void ACTION_OT_layer_prev(wmOperatorType *ot);
|
||||
|
||||
void ACTION_OT_markers_make_local(wmOperatorType *ot);
|
||||
|
||||
/* defines for snap keyframes
|
||||
* NOTE: keep in sync with eEditKeyframes_Snap (in ED_keyframes_edit.h)
|
||||
*/
|
||||
enum eActKeys_Snap_Mode {
|
||||
ACTKEYS_SNAP_CFRA = 1,
|
||||
ACTKEYS_SNAP_NEAREST_FRAME,
|
||||
ACTKEYS_SNAP_NEAREST_SECOND,
|
||||
ACTKEYS_SNAP_NEAREST_MARKER,
|
||||
};
|
||||
|
||||
/* defines for mirror keyframes
|
||||
* NOTE: keep in sync with eEditKeyframes_Mirror (in ED_keyframes_edit.h)
|
||||
*/
|
||||
enum eActKeys_Mirror_Mode {
|
||||
ACTKEYS_MIRROR_CFRA = 1,
|
||||
ACTKEYS_MIRROR_YAXIS,
|
||||
ACTKEYS_MIRROR_XAXIS,
|
||||
ACTKEYS_MIRROR_MARKER,
|
||||
};
|
||||
|
||||
/* ***************************************** */
|
||||
/* action_ops.c */
|
||||
|
||||
void action_operatortypes(void);
|
||||
void action_keymap(wmKeyConfig *keyconf);
|
|
@ -5,15 +5,15 @@
|
|||
* \ingroup spaction
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "DNA_space_types.h"
|
||||
|
||||
#include "ED_anim_api.h"
|
||||
#include "ED_transform.h"
|
||||
|
||||
#include "action_intern.h"
|
||||
#include "action_intern.hh"
|
||||
|
||||
#include "RNA_access.h"
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -5,8 +5,8 @@
|
|||
* \ingroup spaction
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "DNA_action_types.h"
|
||||
#include "DNA_anim_types.h"
|
||||
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include "BLO_read_write.h"
|
||||
|
||||
#include "action_intern.h" /* own include */
|
||||
#include "action_intern.hh" /* own include */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Default Callbacks for Action Space
|
||||
|
@ -55,7 +55,7 @@ static SpaceLink *action_create(const ScrArea *area, const Scene *scene)
|
|||
SpaceAction *saction;
|
||||
ARegion *region;
|
||||
|
||||
saction = MEM_callocN(sizeof(SpaceAction), "initaction");
|
||||
saction = MEM_cnew<SpaceAction>("initaction");
|
||||
saction->spacetype = SPACE_ACTION;
|
||||
|
||||
saction->autosnap = SACTSNAP_FRAME;
|
||||
|
@ -72,14 +72,14 @@ static SpaceLink *action_create(const ScrArea *area, const Scene *scene)
|
|||
saction->cache_display |= TIME_CACHE_RIGIDBODY;
|
||||
|
||||
/* header */
|
||||
region = MEM_callocN(sizeof(ARegion), "header for action");
|
||||
region = MEM_cnew<ARegion>("header for action");
|
||||
|
||||
BLI_addtail(&saction->regionbase, region);
|
||||
region->regiontype = RGN_TYPE_HEADER;
|
||||
region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
|
||||
|
||||
/* channel list region */
|
||||
region = MEM_callocN(sizeof(ARegion), "channel region for action");
|
||||
region = MEM_cnew<ARegion>("channel region for action");
|
||||
BLI_addtail(&saction->regionbase, region);
|
||||
region->regiontype = RGN_TYPE_CHANNELS;
|
||||
region->alignment = RGN_ALIGN_LEFT;
|
||||
|
@ -89,14 +89,14 @@ static SpaceLink *action_create(const ScrArea *area, const Scene *scene)
|
|||
region->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
|
||||
|
||||
/* ui buttons */
|
||||
region = MEM_callocN(sizeof(ARegion), "buttons region for action");
|
||||
region = MEM_cnew<ARegion>("buttons region for action");
|
||||
|
||||
BLI_addtail(&saction->regionbase, region);
|
||||
region->regiontype = RGN_TYPE_UI;
|
||||
region->alignment = RGN_ALIGN_RIGHT;
|
||||
|
||||
/* main region */
|
||||
region = MEM_callocN(sizeof(ARegion), "main region for action");
|
||||
region = MEM_cnew<ARegion>("main region for action");
|
||||
|
||||
BLI_addtail(&saction->regionbase, region);
|
||||
region->regiontype = RGN_TYPE_WINDOW;
|
||||
|
@ -127,21 +127,21 @@ static SpaceLink *action_create(const ScrArea *area, const Scene *scene)
|
|||
}
|
||||
|
||||
/* not spacelink itself */
|
||||
static void action_free(SpaceLink *UNUSED(sl))
|
||||
static void action_free(SpaceLink * /*sl*/)
|
||||
{
|
||||
// SpaceAction *saction = (SpaceAction *) sl;
|
||||
}
|
||||
|
||||
/* spacetype; init callback */
|
||||
static void action_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
|
||||
static void action_init(wmWindowManager * /*wm*/, ScrArea *area)
|
||||
{
|
||||
SpaceAction *saction = area->spacedata.first;
|
||||
SpaceAction *saction = static_cast<SpaceAction *>(area->spacedata.first);
|
||||
saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC;
|
||||
}
|
||||
|
||||
static SpaceLink *action_duplicate(SpaceLink *sl)
|
||||
{
|
||||
SpaceAction *sactionn = MEM_dupallocN(sl);
|
||||
SpaceAction *sactionn = static_cast<SpaceAction *>(MEM_dupallocN(sl));
|
||||
|
||||
memset(&sactionn->runtime, 0x0, sizeof(sactionn->runtime));
|
||||
|
||||
|
@ -192,7 +192,7 @@ static void action_main_region_draw(const bContext *C, ARegion *region)
|
|||
|
||||
/* Draw the manually set intended playback frame range highlight in the Action editor. */
|
||||
if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && saction->action) {
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, NULL);
|
||||
AnimData *adt = ED_actedit_animdata_from_context(C, nullptr);
|
||||
|
||||
ANIM_draw_action_framerange(adt, saction->action, v2d, -FLT_MAX, FLT_MAX);
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ static void action_main_region_draw_overlay(const bContext *C, ARegion *region)
|
|||
ED_time_scrub_draw_current_frame(region, scene, saction->flag & SACTION_DRAWTIME);
|
||||
|
||||
/* scrollers */
|
||||
UI_view2d_scrollers_draw(v2d, NULL);
|
||||
UI_view2d_scrollers_draw(v2d, nullptr);
|
||||
}
|
||||
|
||||
/* add handlers, stuff you only do once or on area/region changes */
|
||||
|
@ -293,7 +293,7 @@ static void action_channel_region_draw(const bContext *C, ARegion *region)
|
|||
}
|
||||
|
||||
/* add handlers, stuff you only do once or on area/region changes */
|
||||
static void action_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
|
||||
static void action_header_region_init(wmWindowManager * /*wm*/, ARegion *region)
|
||||
{
|
||||
ED_region_header_init(region);
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ static void action_channel_region_listener(const wmRegionListenerParams *params)
|
|||
|
||||
static void saction_channel_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
|
||||
{
|
||||
struct wmMsgBus *mbus = params->message_bus;
|
||||
wmMsgBus *mbus = params->message_bus;
|
||||
bScreen *screen = params->screen;
|
||||
ScrArea *area = params->area;
|
||||
ARegion *region = params->region;
|
||||
|
@ -368,11 +368,10 @@ static void saction_channel_region_message_subscribe(const wmRegionMessageSubscr
|
|||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr);
|
||||
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {
|
||||
.owner = region,
|
||||
.user_data = region,
|
||||
.notify = ED_region_do_msg_notify_tag_redraw,
|
||||
};
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
|
||||
msg_sub_value_region_tag_redraw.owner = region;
|
||||
msg_sub_value_region_tag_redraw.user_data = region;
|
||||
msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
|
||||
|
||||
/* All dopesheet filter settings, etc. affect the drawing of this editor,
|
||||
* also same applies for all animation-related datatypes that may appear here,
|
||||
|
@ -477,7 +476,7 @@ static void action_main_region_listener(const wmRegionListenerParams *params)
|
|||
|
||||
static void saction_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
|
||||
{
|
||||
struct wmMsgBus *mbus = params->message_bus;
|
||||
wmMsgBus *mbus = params->message_bus;
|
||||
Scene *scene = params->scene;
|
||||
bScreen *screen = params->screen;
|
||||
ScrArea *area = params->area;
|
||||
|
@ -486,11 +485,10 @@ static void saction_main_region_message_subscribe(const wmRegionMessageSubscribe
|
|||
PointerRNA ptr;
|
||||
RNA_pointer_create(&screen->id, &RNA_SpaceDopeSheetEditor, area->spacedata.first, &ptr);
|
||||
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {
|
||||
.owner = region,
|
||||
.user_data = region,
|
||||
.notify = ED_region_do_msg_notify_tag_redraw,
|
||||
};
|
||||
wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
|
||||
msg_sub_value_region_tag_redraw.owner = region;
|
||||
msg_sub_value_region_tag_redraw.user_data = region;
|
||||
msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
|
||||
|
||||
/* Timeline depends on scene properties. */
|
||||
{
|
||||
|
@ -578,7 +576,7 @@ static void action_listener(const wmSpaceTypeListenerParams *params)
|
|||
case ND_FRAME_RANGE:
|
||||
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
||||
if (region->regiontype == RGN_TYPE_WINDOW) {
|
||||
Scene *scene = wmn->reference;
|
||||
Scene *scene = static_cast<Scene *>(wmn->reference);
|
||||
region->v2d.tot.xmin = (float)(scene->r.sfra - 4);
|
||||
region->v2d.tot.xmax = (float)(scene->r.efra + 4);
|
||||
break;
|
||||
|
@ -801,7 +799,7 @@ static void action_refresh(const bContext *C, ScrArea *area)
|
|||
* or else they don't update #28962.
|
||||
*/
|
||||
ED_area_tag_redraw(area);
|
||||
for (region = area->regionbase.first; region; region = region->next) {
|
||||
for (region = static_cast<ARegion *>(area->regionbase.first); region; region = region->next) {
|
||||
ED_region_tag_redraw(region);
|
||||
}
|
||||
}
|
||||
|
@ -810,9 +808,7 @@ static void action_refresh(const bContext *C, ScrArea *area)
|
|||
/* XXX re-sizing y-extents of tot should go here? */
|
||||
}
|
||||
|
||||
static void action_id_remap(ScrArea *UNUSED(area),
|
||||
SpaceLink *slink,
|
||||
const struct IDRemapper *mappings)
|
||||
static void action_id_remap(ScrArea * /*area*/, SpaceLink *slink, const IDRemapper *mappings)
|
||||
{
|
||||
SpaceAction *sact = (SpaceAction *)slink;
|
||||
|
||||
|
@ -828,13 +824,13 @@ static void action_id_remap(ScrArea *UNUSED(area),
|
|||
*/
|
||||
static int action_space_subtype_get(ScrArea *area)
|
||||
{
|
||||
SpaceAction *sact = area->spacedata.first;
|
||||
SpaceAction *sact = static_cast<SpaceAction *>(area->spacedata.first);
|
||||
return sact->mode == SACTCONT_TIMELINE ? SACTCONT_TIMELINE : SACTCONT_DOPESHEET;
|
||||
}
|
||||
|
||||
static void action_space_subtype_set(ScrArea *area, int value)
|
||||
{
|
||||
SpaceAction *sact = area->spacedata.first;
|
||||
SpaceAction *sact = static_cast<SpaceAction *>(area->spacedata.first);
|
||||
if (value == SACTCONT_TIMELINE) {
|
||||
if (sact->mode != SACTCONT_TIMELINE) {
|
||||
sact->mode_prev = sact->mode;
|
||||
|
@ -846,14 +842,14 @@ static void action_space_subtype_set(ScrArea *area, int value)
|
|||
}
|
||||
}
|
||||
|
||||
static void action_space_subtype_item_extend(bContext *UNUSED(C),
|
||||
static void action_space_subtype_item_extend(bContext * /*C*/,
|
||||
EnumPropertyItem **item,
|
||||
int *totitem)
|
||||
{
|
||||
RNA_enum_items_add(item, totitem, rna_enum_space_action_mode_items);
|
||||
}
|
||||
|
||||
static void action_blend_read_data(BlendDataReader *UNUSED(reader), SpaceLink *sl)
|
||||
static void action_blend_read_data(BlendDataReader * /*reader*/, SpaceLink *sl)
|
||||
{
|
||||
SpaceAction *saction = (SpaceAction *)sl;
|
||||
memset(&saction->runtime, 0x0, sizeof(saction->runtime));
|
||||
|
@ -877,7 +873,7 @@ static void action_blend_write(BlendWriter *writer, SpaceLink *sl)
|
|||
BLO_write_struct(writer, SpaceAction, sl);
|
||||
}
|
||||
|
||||
static void action_main_region_view2d_changed(const bContext *UNUSED(C), ARegion *region)
|
||||
static void action_main_region_view2d_changed(const bContext * /*C*/, ARegion *region)
|
||||
{
|
||||
/* V2D_KEEPTOT_STRICT cannot be used to clamp scrolling
|
||||
* because it also clamps the x-axis to 0. */
|
||||
|
@ -886,7 +882,7 @@ static void action_main_region_view2d_changed(const bContext *UNUSED(C), ARegion
|
|||
|
||||
void ED_spacetype_action(void)
|
||||
{
|
||||
SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype action");
|
||||
SpaceType *st = MEM_cnew<SpaceType>("spacetype action");
|
||||
ARegionType *art;
|
||||
|
||||
st->spaceid = SPACE_ACTION;
|
||||
|
@ -909,7 +905,7 @@ void ED_spacetype_action(void)
|
|||
st->blend_write = action_blend_write;
|
||||
|
||||
/* regions: main window */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
||||
art = MEM_cnew<ARegionType>("spacetype action region");
|
||||
art->regionid = RGN_TYPE_WINDOW;
|
||||
art->init = action_main_region_init;
|
||||
art->draw = action_main_region_draw;
|
||||
|
@ -922,7 +918,7 @@ void ED_spacetype_action(void)
|
|||
BLI_addhead(&st->regiontypes, art);
|
||||
|
||||
/* regions: header */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
||||
art = MEM_cnew<ARegionType>("spacetype action region");
|
||||
art->regionid = RGN_TYPE_HEADER;
|
||||
art->prefsizey = HEADERY;
|
||||
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER;
|
||||
|
@ -934,7 +930,7 @@ void ED_spacetype_action(void)
|
|||
BLI_addhead(&st->regiontypes, art);
|
||||
|
||||
/* regions: channels */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
||||
art = MEM_cnew<ARegionType>("spacetype action region");
|
||||
art->regionid = RGN_TYPE_CHANNELS;
|
||||
art->prefsizex = 200;
|
||||
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES;
|
||||
|
@ -947,7 +943,7 @@ void ED_spacetype_action(void)
|
|||
BLI_addhead(&st->regiontypes, art);
|
||||
|
||||
/* regions: UI buttons */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype action region");
|
||||
art = MEM_cnew<ARegionType>("spacetype action region");
|
||||
art->regionid = RGN_TYPE_UI;
|
||||
art->prefsizex = UI_SIDEBAR_PANEL_WIDTH;
|
||||
art->keymapflag = ED_KEYMAP_UI;
|
|
@ -189,8 +189,10 @@ static void node_add_catalog_assets_draw(const bContext *C, Menu *menu)
|
|||
const_cast<AssetLibraryReference *>(&item.library_ref)};
|
||||
uiLayoutSetContextPointer(col, "asset_library_ref", &library_ptr);
|
||||
|
||||
uiItemO(
|
||||
col, AS_asset_representation_name_get(&item.asset), ICON_NONE, "NODE_OT_add_group_asset");
|
||||
uiItemO(col,
|
||||
IFACE_(AS_asset_representation_name_get(&item.asset)),
|
||||
ICON_NONE,
|
||||
"NODE_OT_add_group_asset");
|
||||
}
|
||||
|
||||
catalog_item->foreach_child([&](asset_system::AssetCatalogTreeItem &child_item) {
|
||||
|
@ -200,7 +202,7 @@ static void node_add_catalog_assets_draw(const bContext *C, Menu *menu)
|
|||
&screen.id, &RNA_AssetCatalogPath, const_cast<asset_system::AssetCatalogPath *>(&path)};
|
||||
uiLayout *col = uiLayoutColumn(layout, false);
|
||||
uiLayoutSetContextPointer(col, "asset_catalog_path", &path_ptr);
|
||||
uiItemM(col, "NODE_MT_node_add_catalog_assets", path.name().c_str(), ICON_NONE);
|
||||
uiItemM(col, "NODE_MT_node_add_catalog_assets", IFACE_(path.name().c_str()), ICON_NONE);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -270,7 +272,7 @@ static void add_root_catalogs_draw(const bContext *C, Menu *menu)
|
|||
&screen.id, &RNA_AssetCatalogPath, const_cast<asset_system::AssetCatalogPath *>(&path)};
|
||||
uiLayout *col = uiLayoutColumn(layout, false);
|
||||
uiLayoutSetContextPointer(col, "asset_catalog_path", &path_ptr);
|
||||
uiItemM(col, "NODE_MT_node_add_catalog_assets", path.name().c_str(), ICON_NONE);
|
||||
uiItemM(col, "NODE_MT_node_add_catalog_assets", IFACE_(path.name().c_str()), ICON_NONE);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -468,7 +468,7 @@ static char *node_add_group_asset_get_description(struct bContext *C,
|
|||
if (!asset_data.description) {
|
||||
return nullptr;
|
||||
}
|
||||
return BLI_strdup(asset_data.description);
|
||||
return BLI_strdup(DATA_(asset_data.description));
|
||||
}
|
||||
|
||||
void NODE_OT_add_group_asset(wmOperatorType *ot)
|
||||
|
|
|
@ -861,7 +861,7 @@ void initSnapping(TransInfo *t, wmOperator *op)
|
|||
}
|
||||
/* use scene defaults only when transform is modal */
|
||||
else if (t->flag & T_MODAL) {
|
||||
if (transformModeUseSnap(t) && (t->tsnap.flag & SCE_SNAP)) {
|
||||
if (t->tsnap.flag & SCE_SNAP) {
|
||||
t->modifiers |= MOD_SNAP;
|
||||
}
|
||||
|
||||
|
@ -881,6 +881,8 @@ void initSnapping(TransInfo *t, wmOperator *op)
|
|||
|
||||
t->tsnap.source_operation = snap_source;
|
||||
|
||||
transform_snap_flag_from_modifiers_set(t);
|
||||
|
||||
initSnappingMode(t);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,15 +18,21 @@
|
|||
struct UnwrapOptions;
|
||||
|
||||
enum eUVPackIsland_MarginMethod {
|
||||
ED_UVPACK_MARGIN_SCALED = 0, /* Use scale of existing UVs to multiply margin. */
|
||||
ED_UVPACK_MARGIN_ADD, /* Just add the margin, ignoring any UV scale. */
|
||||
ED_UVPACK_MARGIN_FRACTION, /* Specify a precise fraction of final UV output. */
|
||||
/** Use scale of existing UVs to multiply margin. */
|
||||
ED_UVPACK_MARGIN_SCALED = 0,
|
||||
/** Just add the margin, ignoring any UV scale. */
|
||||
ED_UVPACK_MARGIN_ADD,
|
||||
/** Specify a precise fraction of final UV output. */
|
||||
ED_UVPACK_MARGIN_FRACTION,
|
||||
};
|
||||
|
||||
enum eUVPackIsland_ShapeMethod {
|
||||
ED_UVPACK_SHAPE_AABB = 0, /* Use Axis-Aligned Bounding-Boxes. */
|
||||
ED_UVPACK_SHAPE_CONVEX, /* Use convex hull. */
|
||||
ED_UVPACK_SHAPE_CONCAVE, /* Use concave hull. */
|
||||
/** Use Axis-Aligned Bounding-Boxes. */
|
||||
ED_UVPACK_SHAPE_AABB = 0,
|
||||
/** Use convex hull. */
|
||||
ED_UVPACK_SHAPE_CONVEX,
|
||||
/** Use concave hull. */
|
||||
ED_UVPACK_SHAPE_CONCAVE,
|
||||
};
|
||||
|
||||
namespace blender::geometry {
|
||||
|
@ -67,15 +73,17 @@ class UVPackIsland_Params {
|
|||
class PackIsland {
|
||||
public:
|
||||
rctf bounds_rect;
|
||||
float2 pre_translate; /* Output. */
|
||||
int caller_index; /* Unchanged by #pack_islands, used by caller. */
|
||||
/** Output. */
|
||||
float2 pre_translate;
|
||||
/** Unchanged by #pack_islands, used by caller. */
|
||||
int caller_index;
|
||||
|
||||
void add_triangle(const float2 uv0, const float2 uv1, const float2 uv2);
|
||||
void add_polygon(const blender::Span<float2> uvs, MemArena *arena, Heap *heap);
|
||||
void finalize_geometry(const UVPackIsland_Params ¶ms, MemArena *arena, Heap *heap);
|
||||
|
||||
private:
|
||||
blender::Vector<float2> triangleVertices;
|
||||
blender::Vector<float2> triangle_vertices_;
|
||||
friend class Occupancy;
|
||||
};
|
||||
|
||||
|
|
|
@ -24,22 +24,22 @@
|
|||
|
||||
namespace blender::geometry {
|
||||
|
||||
/** Compute `r = mat * (a + b)` with high precision.
|
||||
void mul_v2_m2_add_v2v2(float r[2], const float mat[2][2], const float a[2], const float b[2])
|
||||
{
|
||||
/* Compute `r = mat * (a + b)` with high precision.
|
||||
*
|
||||
* Often, linear transforms are written as:
|
||||
* `A.x + b`
|
||||
*
|
||||
* When transforming UVs, the familiar expression can
|
||||
* damage UVs due to round-off error, expecially when
|
||||
* using UDIM and if there are large numbers of islands.
|
||||
* When transforming UVs, the familiar expression can damage UVs due to round-off error,
|
||||
* especially when using UDIM and if there are large numbers of islands.
|
||||
*
|
||||
* Instead, we provide a helper which evaluates:
|
||||
* `A. (x + b)`
|
||||
*
|
||||
* To further reduce damage, all internal calculations are
|
||||
* performed using double precision. */
|
||||
void mul_v2_m2_add_v2v2(float r[2], const float mat[2][2], const float a[2], const float b[2])
|
||||
{
|
||||
|
||||
const double x = double(a[0]) + double(b[0]);
|
||||
const double y = double(a[1]) + double(b[1]);
|
||||
|
||||
|
@ -47,7 +47,8 @@ void mul_v2_m2_add_v2v2(float r[2], const float mat[2][2], const float a[2], con
|
|||
r[1] = float(mat[0][1] * x + mat[1][1] * y);
|
||||
}
|
||||
|
||||
/* Compute signed distance squared to a line passing through `uva` and `uvb`.
|
||||
/**
|
||||
* Compute signed distance squared to a line passing through `uva` and `uvb`.
|
||||
*/
|
||||
static float dist_signed_squared_to_edge(float2 probe, float2 uva, float2 uvb)
|
||||
{
|
||||
|
@ -70,14 +71,14 @@ void PackIsland::add_triangle(const float2 uv0, const float2 uv1, const float2 u
|
|||
{
|
||||
/* Be careful with winding. */
|
||||
if (dist_signed_squared_to_edge(uv0, uv1, uv2) < 0.0f) {
|
||||
triangleVertices.append(uv0);
|
||||
triangleVertices.append(uv1);
|
||||
triangleVertices.append(uv2);
|
||||
triangle_vertices_.append(uv0);
|
||||
triangle_vertices_.append(uv1);
|
||||
triangle_vertices_.append(uv2);
|
||||
}
|
||||
else {
|
||||
triangleVertices.append(uv0);
|
||||
triangleVertices.append(uv2);
|
||||
triangleVertices.append(uv1);
|
||||
triangle_vertices_.append(uv0);
|
||||
triangle_vertices_.append(uv2);
|
||||
triangle_vertices_.append(uv1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,32 +125,28 @@ void PackIsland::add_polygon(const blender::Span<float2> uvs, MemArena *arena, H
|
|||
|
||||
void PackIsland::finalize_geometry(const UVPackIsland_Params ¶ms, MemArena *arena, Heap *heap)
|
||||
{
|
||||
BLI_assert(triangleVertices.size() >= 3);
|
||||
BLI_assert(triangle_vertices_.size() >= 3);
|
||||
const eUVPackIsland_ShapeMethod shape_method = params.shape_method;
|
||||
if (shape_method == ED_UVPACK_SHAPE_CONVEX) {
|
||||
/* Compute convex hull of existing triangles. */
|
||||
if (triangleVertices.size() <= 3) {
|
||||
if (triangle_vertices_.size() <= 3) {
|
||||
return; /* Trivial case, nothing to do. */
|
||||
}
|
||||
|
||||
int vert_count = int(triangleVertices.size());
|
||||
int vert_count = int(triangle_vertices_.size());
|
||||
|
||||
/* Allocate storage. */
|
||||
int *index_map = static_cast<int *>(
|
||||
BLI_memarena_alloc(arena, sizeof(*index_map) * vert_count));
|
||||
float(*source)[2] = static_cast<float(*)[2]>(
|
||||
BLI_memarena_alloc(arena, sizeof(*source) * size_t(vert_count)));
|
||||
|
||||
/* Prepare input for convex hull. */
|
||||
for (int i = 0; i < vert_count; i++) {
|
||||
copy_v2_v2(source[i], triangleVertices[i]);
|
||||
}
|
||||
float(*source)[2] = reinterpret_cast<float(*)[2]>(triangle_vertices_.data());
|
||||
|
||||
/* Compute convex hull. */
|
||||
int convex_len = BLI_convexhull_2d(source, vert_count, index_map);
|
||||
|
||||
/* Write back. */
|
||||
triangleVertices.clear();
|
||||
triangle_vertices_.clear();
|
||||
blender::Array<float2> convexVertices(convex_len);
|
||||
for (int i = 0; i < convex_len; i++) {
|
||||
convexVertices[i] = source[index_map[i]];
|
||||
|
@ -277,17 +274,17 @@ class Occupancy {
|
|||
int bitmap_radix; /* Width and Height of `bitmap`. */
|
||||
float bitmap_scale_reciprocal; /* == 1.0f / `bitmap_scale`. */
|
||||
private:
|
||||
mutable blender::Array<float> bitmap;
|
||||
mutable blender::Array<float> bitmap_;
|
||||
|
||||
mutable float2 witness; /* Witness to a previously known occupied pixel. */
|
||||
mutable float witness_distance; /* Signed distance to nearest placed island. */
|
||||
mutable uint triangle_hint; /* Hint to a previously suspected overlapping triangle. */
|
||||
mutable float2 witness_; /* Witness to a previously known occupied pixel. */
|
||||
mutable float witness_distance_; /* Signed distance to nearest placed island. */
|
||||
mutable uint triangle_hint_; /* Hint to a previously suspected overlapping triangle. */
|
||||
|
||||
const float terminal = 1048576.0f; /* A "very" large number, much bigger than 4 * bitmap_radix */
|
||||
};
|
||||
|
||||
Occupancy::Occupancy(const float initial_scale)
|
||||
: bitmap_radix(800), bitmap(bitmap_radix * bitmap_radix, false)
|
||||
: bitmap_radix(800), bitmap_(bitmap_radix * bitmap_radix, false)
|
||||
{
|
||||
increase_scale();
|
||||
bitmap_scale_reciprocal = bitmap_radix / initial_scale;
|
||||
|
@ -297,12 +294,12 @@ void Occupancy::increase_scale()
|
|||
{
|
||||
bitmap_scale_reciprocal *= 0.5f;
|
||||
for (int i = 0; i < bitmap_radix * bitmap_radix; i++) {
|
||||
bitmap[i] = terminal;
|
||||
bitmap_[i] = terminal;
|
||||
}
|
||||
witness.x = -1;
|
||||
witness.y = -1;
|
||||
witness_distance = 0.0f;
|
||||
triangle_hint = 0;
|
||||
witness_.x = -1;
|
||||
witness_.y = -1;
|
||||
witness_distance_ = 0.0f;
|
||||
triangle_hint_ = 0;
|
||||
}
|
||||
|
||||
static float signed_distance_fat_triangle(const float2 probe,
|
||||
|
@ -351,10 +348,10 @@ float Occupancy::trace_triangle(const float2 &uv0,
|
|||
epsilon = std::max(epsilon, 2 * margin * bitmap_scale_reciprocal);
|
||||
|
||||
if (!write) {
|
||||
if (ix0 <= witness.x && witness.x < ix1) {
|
||||
if (iy0 <= witness.y && witness.y < iy1) {
|
||||
const float distance = signed_distance_fat_triangle(witness, uv0s, uv1s, uv2s);
|
||||
const float extent = epsilon - distance - witness_distance;
|
||||
if (ix0 <= witness_.x && witness_.x < ix1) {
|
||||
if (iy0 <= witness_.y && witness_.y < iy1) {
|
||||
const float distance = signed_distance_fat_triangle(witness_, uv0s, uv1s, uv2s);
|
||||
const float extent = epsilon - distance - witness_distance_;
|
||||
if (extent > 0.0f) {
|
||||
return extent; /* Witness observes occupied. */
|
||||
}
|
||||
|
@ -365,7 +362,7 @@ float Occupancy::trace_triangle(const float2 &uv0,
|
|||
/* Iterate in opposite direction to outer search to improve witness effectiveness. */
|
||||
for (int y = iy1 - 1; y >= iy0; y--) {
|
||||
for (int x = ix1 - 1; x >= ix0; x--) {
|
||||
float *hotspot = &bitmap[y * bitmap_radix + x];
|
||||
float *hotspot = &bitmap_[y * bitmap_radix + x];
|
||||
if (!write && *hotspot > epsilon) {
|
||||
continue;
|
||||
}
|
||||
|
@ -377,8 +374,8 @@ float Occupancy::trace_triangle(const float2 &uv0,
|
|||
}
|
||||
const float extent = epsilon - distance - *hotspot;
|
||||
if (extent > 0.0f) {
|
||||
witness = probe;
|
||||
witness_distance = *hotspot;
|
||||
witness_ = probe;
|
||||
witness_distance_ = *hotspot;
|
||||
return extent; /* Occupied. */
|
||||
}
|
||||
}
|
||||
|
@ -400,17 +397,17 @@ float Occupancy::trace_island(PackIsland *island,
|
|||
}
|
||||
const float2 origin(island->bounds_rect.xmin, island->bounds_rect.ymin);
|
||||
const float2 delta = uv - origin * scale;
|
||||
uint vert_count = uint(island->triangleVertices.size());
|
||||
uint vert_count = uint(island->triangle_vertices_.size());
|
||||
for (uint i = 0; i < vert_count; i += 3) {
|
||||
uint j = (i + triangle_hint) % vert_count;
|
||||
float extent = trace_triangle(delta + island->triangleVertices[j] * scale,
|
||||
delta + island->triangleVertices[j + 1] * scale,
|
||||
delta + island->triangleVertices[j + 2] * scale,
|
||||
uint j = (i + triangle_hint_) % vert_count;
|
||||
float extent = trace_triangle(delta + island->triangle_vertices_[j] * scale,
|
||||
delta + island->triangle_vertices_[j + 1] * scale,
|
||||
delta + island->triangle_vertices_[j + 2] * scale,
|
||||
margin,
|
||||
write);
|
||||
|
||||
if (!write && extent >= 0.0f) {
|
||||
triangle_hint = j;
|
||||
triangle_hint_ = j;
|
||||
return extent; /* Occupied. */
|
||||
}
|
||||
}
|
||||
|
@ -463,12 +460,12 @@ static float guess_initial_scale(const Span<PackIsland *> islands,
|
|||
}
|
||||
|
||||
/**
|
||||
* Pack irregular islands using the "xatlas" strategy, with no rotation.
|
||||
* Pack irregular islands using the `xatlas` strategy, with no rotation.
|
||||
*
|
||||
* Loosely based on the 'xatlas' code by Jonathan Young
|
||||
* from https://github.com/jpcy/xatlas
|
||||
*
|
||||
* A brute force packer (BFPacker) with accelerators:
|
||||
* A brute force packer (BF-Packer) with accelerators:
|
||||
* - Uses a Bitmap Occupancy class.
|
||||
* - Uses a "Witness Pixel" and a "Triangle Hint".
|
||||
* - Write with `margin * 2`, read with `margin == 0`.
|
||||
|
@ -493,9 +490,9 @@ static void pack_island_xatlas(const Span<UVAABBIsland *> island_indices,
|
|||
int i = 0;
|
||||
|
||||
/* The following `while` loop is setting up a three-way race:
|
||||
* for (scan_line=0; scan_line<bitmap_radix; scan_line++)
|
||||
* for (i : island_indices.index_range())
|
||||
* while (bitmap_scale_reciprocal > 0) { bitmap_scale_reciprocal *= 0.5f; }
|
||||
* `for (scan_line = 0; scan_line < bitmap_radix; scan_line++)`
|
||||
* `for (i : island_indices.index_range())`
|
||||
* `while (bitmap_scale_reciprocal > 0) { bitmap_scale_reciprocal *= 0.5f; }`
|
||||
*/
|
||||
|
||||
while (i < island_indices.size()) {
|
||||
|
@ -511,10 +508,9 @@ static void pack_island_xatlas(const Span<UVAABBIsland *> island_indices,
|
|||
else {
|
||||
/* Increasing by 2 here has the effect of changing the sampling pattern.
|
||||
* The parameter '2' is not "free" in the sense that changing it requires
|
||||
* a change to `bitmap_radix` and then retuning `alpaca_cutoff`.
|
||||
* a change to `bitmap_radix` and then returning `alpaca_cutoff`.
|
||||
* Possible values here *could* be 1, 2 or 3, however the only *reasonable*
|
||||
* choice is 2.
|
||||
*/
|
||||
* choice is 2. */
|
||||
scan_line += 2;
|
||||
}
|
||||
if (scan_line < occupancy.bitmap_radix) {
|
||||
|
@ -596,10 +592,8 @@ static float pack_islands_scale_margin(const Span<PackIsland *> islands,
|
|||
|
||||
/* Partition `islands`, largest will go to a slow packer, the rest alpaca_turbo.
|
||||
* See discussion above for details. */
|
||||
int64_t alpaca_cutoff = int64_t(
|
||||
1024); /* Regular situation, pack 1024 islands with slow packer. */
|
||||
int64_t alpaca_cutoff_fast = int64_t(
|
||||
80); /* Reduced problem size, only 80 islands with slow packer. */
|
||||
int64_t alpaca_cutoff = 1024; /* Regular situation, pack 1024 islands with slow packer. */
|
||||
int64_t alpaca_cutoff_fast = 80; /* Reduced problem size, only 80 islands with slow packer. */
|
||||
if (params.margin_method == ED_UVPACK_MARGIN_FRACTION) {
|
||||
if (margin > 0.0f) {
|
||||
alpaca_cutoff = alpaca_cutoff_fast;
|
||||
|
@ -678,11 +672,11 @@ static float pack_islands_margin_fraction(const Span<PackIsland *> &island_vecto
|
|||
|
||||
/* Scaling smaller than `min_scale_roundoff` is unlikely to fit and
|
||||
* will destroy information in existing UVs. */
|
||||
float min_scale_roundoff = 1e-5f;
|
||||
const float min_scale_roundoff = 1e-5f;
|
||||
|
||||
/* Certain inputs might have poor convergence properties.
|
||||
* Use `max_iteration` to prevent an infinite loop. */
|
||||
int max_iteration = 25;
|
||||
const int max_iteration = 25;
|
||||
for (int iteration = 0; iteration < max_iteration; iteration++) {
|
||||
float scale = 1.0f;
|
||||
|
||||
|
@ -728,9 +722,9 @@ static float pack_islands_margin_fraction(const Span<PackIsland *> &island_vecto
|
|||
|
||||
/* Evaluate our `f`. */
|
||||
scale_last = scale;
|
||||
float max_uv = pack_islands_scale_margin(
|
||||
const float max_uv = pack_islands_scale_margin(
|
||||
island_vector, box_array, scale_last, margin_fraction, params);
|
||||
float value = sqrtf(max_uv) - 1.0f;
|
||||
const float value = sqrtf(max_uv) - 1.0f;
|
||||
|
||||
if (value <= 0.0f) {
|
||||
scale_low = scale;
|
||||
|
@ -752,7 +746,7 @@ static float pack_islands_margin_fraction(const Span<PackIsland *> &island_vecto
|
|||
/* Write back best pack as a side-effect. First get best pack. */
|
||||
if (scale_last != scale_low) {
|
||||
scale_last = scale_low;
|
||||
float max_uv = pack_islands_scale_margin(
|
||||
const float max_uv = pack_islands_scale_margin(
|
||||
island_vector, box_array, scale_last, margin_fraction, params);
|
||||
UNUSED_VARS(max_uv);
|
||||
/* TODO (?): `if (max_uv < 1.0f) { scale_last /= max_uv; }` */
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
|
||||
namespace blender::gpu::shader {
|
||||
|
||||
#ifndef GPU_SHADER_CREATE_INFO
|
||||
/* Helps intellisense / auto-completion. */
|
||||
#ifndef GPU_SHADER_CREATE_INFO
|
||||
# define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name) \
|
||||
StageInterfaceInfo _interface(#_interface, _inst_name); \
|
||||
_interface
|
||||
|
|
|
@ -14,13 +14,12 @@ set(INC
|
|||
../../makesdna
|
||||
../../makesrna
|
||||
../../windowmanager
|
||||
../../../../extern/fast_float
|
||||
../../../../extern/fmtlib/include
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
../../../../extern/fast_float
|
||||
../../../../extern/fmtlib/include
|
||||
)
|
||||
|
||||
set(SRC
|
||||
|
|
|
@ -15,13 +15,12 @@ set(INC
|
|||
../../makesrna
|
||||
../../nodes
|
||||
../../windowmanager
|
||||
../../../../extern/fast_float
|
||||
../../../../extern/fmtlib/include
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
|
||||
../../../../extern/fast_float
|
||||
../../../../extern/fmtlib/include
|
||||
)
|
||||
|
||||
set(SRC
|
||||
|
|
|
@ -154,9 +154,12 @@ typedef enum eArmature_Flag {
|
|||
ARM_DRAWAXES = (1 << 2),
|
||||
ARM_DRAWNAMES = (1 << 3),
|
||||
ARM_POSEMODE = (1 << 4),
|
||||
ARM_FLAG_UNUSED_5 = (1 << 5), /* cleared */
|
||||
/** Position of the parent-child relation lines on the bone (cleared = drawn
|
||||
* from the tail, set = drawn from the head). Only controls the parent side of
|
||||
* the line; the child side is always drawn to the head of the bone. */
|
||||
ARM_DRAW_RELATION_FROM_HEAD = (1 << 5), /* Cleared in versioning of pre-2.80 files. */
|
||||
ARM_FLAG_UNUSED_6 = (1 << 6), /* cleared */
|
||||
ARM_FLAG_UNUSED_7 = (1 << 7),
|
||||
ARM_FLAG_UNUSED_7 = (1 << 7), /* cleared */
|
||||
ARM_MIRROR_EDIT = (1 << 8),
|
||||
ARM_FLAG_UNUSED_9 = (1 << 9),
|
||||
/** Made option negative, for backwards compatibility. */
|
||||
|
|
|
@ -41,7 +41,7 @@ typedef struct CustomDataLayer {
|
|||
int active_clone;
|
||||
/** Number of the layer to render. */
|
||||
int active_mask;
|
||||
/** Shape keyblock unique id reference. */
|
||||
/** Shape key-block unique id reference. */
|
||||
int uid;
|
||||
/** Layer name, MAX_CUSTOMDATA_LAYER_NAME. */
|
||||
char name[68];
|
||||
|
@ -84,7 +84,7 @@ typedef struct CustomData {
|
|||
int totsize;
|
||||
/** (BMesh Only): Memory pool for allocation of blocks. */
|
||||
struct BLI_mempool *pool;
|
||||
/** External file storing customdata layers. */
|
||||
/** External file storing custom-data layers. */
|
||||
CustomDataExternal *external;
|
||||
} CustomData;
|
||||
|
||||
|
|
|
@ -653,6 +653,30 @@ static void rna_Armature_transform(bArmature *arm, float mat[16])
|
|||
ED_armature_transform(arm, (const float(*)[4])mat, true);
|
||||
}
|
||||
|
||||
static int rna_Armature_relation_line_position_get(PointerRNA *ptr)
|
||||
{
|
||||
bArmature *arm = (bArmature *)ptr->data;
|
||||
/* Translate the bitflag to an EnumPropertyItem prop_relation_lines_items item ID. */
|
||||
return (arm->flag & ARM_DRAW_RELATION_FROM_HEAD) ? 1 : 0;
|
||||
}
|
||||
|
||||
static void rna_Armature_relation_line_position_set(PointerRNA *ptr, const int value)
|
||||
{
|
||||
bArmature *arm = (bArmature *)ptr->data;
|
||||
|
||||
/* Translate the EnumPropertyItem prop_relation_lines_items item ID to a bitflag */
|
||||
switch (value) {
|
||||
case 0:
|
||||
arm->flag &= ~ARM_DRAW_RELATION_FROM_HEAD;
|
||||
break;
|
||||
case 1:
|
||||
arm->flag |= ARM_DRAW_RELATION_FROM_HEAD;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone, bool is_editbone)
|
||||
|
@ -1460,6 +1484,11 @@ static void rna_def_armature(BlenderRNA *brna)
|
|||
"Show Armature in binding pose state (no posing possible)"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
};
|
||||
static const EnumPropertyItem prop_relation_lines_items[] = {
|
||||
{0, "TAIL", 0, "Tail", "Draw the relationship line from the parent tail to the child head"},
|
||||
{1, "HEAD", 0, "Head", "Draw the relationship line from the parent head to the child head"},
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
};
|
||||
|
||||
srna = RNA_def_struct(brna, "Armature", "ID");
|
||||
RNA_def_struct_ui_text(
|
||||
|
@ -1554,6 +1583,20 @@ static void rna_def_armature(BlenderRNA *brna)
|
|||
"closer to the tip; decreasing moves it closer to the root");
|
||||
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
|
||||
|
||||
RNA_define_verify_sdna(false); /* This property does not live in DNA. */
|
||||
prop = RNA_def_property(srna, "relation_line_position", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, prop_relation_lines_items);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Relation Line Position",
|
||||
"The start position of the relation lines from parent to child bones");
|
||||
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
|
||||
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
|
||||
RNA_def_property_enum_funcs(prop,
|
||||
"rna_Armature_relation_line_position_get",
|
||||
"rna_Armature_relation_line_position_set",
|
||||
/*item function*/ NULL);
|
||||
RNA_define_verify_sdna(true); /* Restore default. */
|
||||
|
||||
prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES);
|
||||
RNA_def_property_ui_text(prop, "Display Names", "Display bone names");
|
||||
|
|
|
@ -201,6 +201,17 @@ static PointerRNA rna_ViewLayer_depsgraph_get(PointerRNA *ptr)
|
|||
return PointerRNA_NULL;
|
||||
}
|
||||
|
||||
static void rna_ViewLayer_remove_aov(struct ViewLayer *view_layer,
|
||||
ReportList *reports,
|
||||
struct ViewLayerAOV *aov)
|
||||
{
|
||||
if (BLI_findindex(&view_layer->aovs, aov) == -1) {
|
||||
BKE_reportf(reports, RPT_ERROR, "AOV not found in view-layer '%s'", view_layer->name);
|
||||
return;
|
||||
}
|
||||
BKE_view_layer_remove_aov(view_layer, aov);
|
||||
}
|
||||
|
||||
static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
||||
{
|
||||
ViewLayer *view_layer = (ViewLayer *)ptr->data;
|
||||
|
|
|
@ -3039,6 +3039,10 @@ static void rna_def_mloopuv(BlenderRNA *brna)
|
|||
|
||||
prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
|
||||
RNA_def_property_struct_type(prop, "MeshUVLoop");
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"MeshUVLoop (Deprecated)",
|
||||
"Deprecated, use 'uv', 'vertex_select', 'edge_select' or 'pin' properties instead");
|
||||
RNA_def_property_collection_funcs(prop,
|
||||
"rna_MeshUVLoopLayer_data_begin",
|
||||
"rna_iterator_array_next",
|
||||
|
|
|
@ -4281,7 +4281,7 @@ static void rna_def_view_layer_eevee(BlenderRNA *brna)
|
|||
static void rna_def_view_layer_aovs(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
{
|
||||
StructRNA *srna;
|
||||
/* PropertyRNA *prop; */
|
||||
// PropertyRNA *prop;
|
||||
|
||||
FunctionRNA *func;
|
||||
PropertyRNA *parm;
|
||||
|
@ -4295,9 +4295,11 @@ static void rna_def_view_layer_aovs(BlenderRNA *brna, PropertyRNA *cprop)
|
|||
parm = RNA_def_pointer(func, "aov", "AOV", "", "Newly created AOV");
|
||||
RNA_def_function_return(func, parm);
|
||||
|
||||
func = RNA_def_function(srna, "remove", "BKE_view_layer_remove_aov");
|
||||
/* Defined in `rna_layer.c`. */
|
||||
func = RNA_def_function(srna, "remove", "rna_ViewLayer_remove_aov");
|
||||
parm = RNA_def_pointer(func, "aov", "AOV", "", "AOV to remove");
|
||||
RNA_def_function_ui_description(func, "Remove an AOV");
|
||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
|
||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
||||
}
|
||||
|
|
|
@ -516,6 +516,7 @@ class ImageOperation : public NodeOperation {
|
|||
}
|
||||
|
||||
ImageUser image_user = compute_image_user_for_output(identifier);
|
||||
BKE_image_ensure_gpu_texture(get_image(), &image_user);
|
||||
GPUTexture *image_texture = BKE_image_get_gpu_texture(get_image(), &image_user, nullptr);
|
||||
|
||||
const int2 size = int2(GPU_texture_width(image_texture), GPU_texture_height(image_texture));
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include "BLI_bounds_types.hh"
|
||||
#include "BLI_math_matrix_types.hh"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
#include "BLI_utildefines.h"
|
||||
|
@ -70,6 +71,15 @@ Mesh *create_cylinder_or_cone_mesh(float radius_top,
|
|||
GeometryNodeMeshCircleFillType fill_type,
|
||||
ConeAttributeOutputs &attribute_outputs);
|
||||
|
||||
/**
|
||||
* Calculates the bounds of a radial primitive.
|
||||
* The algorithm assumes X-axis symmetry of primitives.
|
||||
*/
|
||||
Bounds<float3> calculate_bounds_radial_primitive(float radius_top,
|
||||
float radius_bottom,
|
||||
int segments,
|
||||
float height);
|
||||
|
||||
/**
|
||||
* Returns the parts of the geometry that are on the selection for the given domain. If the domain
|
||||
* is not applicable for the component, e.g. face domain for point cloud, nothing happens to that
|
||||
|
|
|
@ -99,6 +99,11 @@ static int circle_face_total(const GeometryNodeMeshCircleFillType fill_type, con
|
|||
return 0;
|
||||
}
|
||||
|
||||
static Bounds<float3> calculate_bounds_circle(const float radius, const int verts_num)
|
||||
{
|
||||
return calculate_bounds_radial_primitive(0.0f, radius, verts_num, 0.0f);
|
||||
}
|
||||
|
||||
static Mesh *create_circle_mesh(const float radius,
|
||||
const int verts_num,
|
||||
const GeometryNodeMeshCircleFillType fill_type)
|
||||
|
@ -167,6 +172,8 @@ static Mesh *create_circle_mesh(const float radius,
|
|||
}
|
||||
}
|
||||
|
||||
mesh->bounds_set_eager(calculate_bounds_circle(radius, verts_num));
|
||||
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
|
|
@ -664,6 +664,31 @@ static Mesh *create_vertex_mesh()
|
|||
return mesh;
|
||||
}
|
||||
|
||||
Bounds<float3> calculate_bounds_radial_primitive(const float radius_top,
|
||||
const float radius_bottom,
|
||||
const int segments,
|
||||
const float height)
|
||||
{
|
||||
const float radius = std::max(radius_top, radius_bottom);
|
||||
const float delta_phi = (2.0f * M_PI) / float(segments);
|
||||
|
||||
const float x_max = radius;
|
||||
const float x_min = std::cos(std::round(0.5f * segments) * delta_phi) * radius;
|
||||
const float y_max = std::sin(std::round(0.25f * segments) * delta_phi) * radius;
|
||||
const float y_min = -y_max;
|
||||
|
||||
const float3 bounds_min(x_min, y_min, -height);
|
||||
const float3 bounds_max(x_max, y_max, height);
|
||||
|
||||
return {bounds_min, bounds_max};
|
||||
}
|
||||
|
||||
static Bounds<float3> calculate_bounds_cylinder(const ConeConfig &config)
|
||||
{
|
||||
return calculate_bounds_radial_primitive(
|
||||
config.radius_top, config.radius_bottom, config.circle_segments, config.height);
|
||||
}
|
||||
|
||||
Mesh *create_cylinder_or_cone_mesh(const float radius_top,
|
||||
const float radius_bottom,
|
||||
const float depth,
|
||||
|
@ -708,6 +733,7 @@ Mesh *create_cylinder_or_cone_mesh(const float radius_top,
|
|||
calculate_selection_outputs(config, attribute_outputs, mesh->attributes_for_write());
|
||||
|
||||
mesh->loose_edges_tag_none();
|
||||
mesh->bounds_set_eager(calculate_bounds_cylinder(config));
|
||||
|
||||
return mesh;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,34 @@ static void node_declare(NodeDeclarationBuilder &b)
|
|||
b.add_output<decl::Vector>(N_("UV Map")).field_on_all();
|
||||
}
|
||||
|
||||
static Bounds<float3> calculate_bounds_ico_sphere(const float radius, const int subdivisions)
|
||||
{
|
||||
const float delta_phi = (2.0f * M_PI) / 5.0f;
|
||||
const float theta = std::cos(std::atan(0.5f));
|
||||
const float ro = radius * std::sin(delta_phi);
|
||||
|
||||
float x_max = radius;
|
||||
float x_min = -radius;
|
||||
float y_max = radius;
|
||||
float y_min = -radius;
|
||||
|
||||
if (subdivisions == 1) {
|
||||
x_max = radius * theta;
|
||||
x_min = -x_max;
|
||||
y_max = ro * theta;
|
||||
y_min = -y_max;
|
||||
}
|
||||
else if (subdivisions == 2) {
|
||||
x_max = ro;
|
||||
x_min = -x_max;
|
||||
}
|
||||
|
||||
const float3 bounds_min(x_min, y_min, -radius);
|
||||
const float3 bounds_max(x_max, y_max, radius);
|
||||
|
||||
return {bounds_min, bounds_max};
|
||||
}
|
||||
|
||||
static Mesh *create_ico_sphere_mesh(const int subdivisions,
|
||||
const float radius,
|
||||
const AttributeIDRef &uv_map_id)
|
||||
|
@ -73,6 +101,8 @@ static Mesh *create_ico_sphere_mesh(const int subdivisions,
|
|||
}
|
||||
attributes.remove("UVMap");
|
||||
|
||||
mesh->bounds_set_eager(calculate_bounds_ico_sphere(radius, subdivisions));
|
||||
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
|
|
@ -302,6 +302,16 @@ BLI_NOINLINE static void calculate_sphere_uvs(Mesh *mesh,
|
|||
uv_attribute.finish();
|
||||
}
|
||||
|
||||
static Bounds<float3> calculate_bounds_uv_sphere(const float radius,
|
||||
const int segments,
|
||||
const int rings)
|
||||
{
|
||||
const float delta_theta = M_PI / float(rings);
|
||||
const float sin_equator = std::sin(std::round(0.5f * rings) * delta_theta);
|
||||
|
||||
return calculate_bounds_radial_primitive(0.0f, radius * sin_equator, segments, radius);
|
||||
}
|
||||
|
||||
static Mesh *create_uv_sphere_mesh(const float radius,
|
||||
const int segments,
|
||||
const int rings,
|
||||
|
@ -337,6 +347,7 @@ static Mesh *create_uv_sphere_mesh(const float radius,
|
|||
});
|
||||
|
||||
mesh->loose_edges_tag_none();
|
||||
mesh->bounds_set_eager(calculate_bounds_uv_sphere(radius, segments, rings));
|
||||
|
||||
BLI_assert(BKE_mesh_is_valid(mesh));
|
||||
|
||||
|
|
|
@ -710,7 +710,7 @@ static struct PyMethodDef bpy_bmdeformvert_methods[] = {
|
|||
{"values", (PyCFunction)bpy_bmdeformvert_values, METH_NOARGS, bpy_bmdeformvert_values_doc},
|
||||
{"items", (PyCFunction)bpy_bmdeformvert_items, METH_NOARGS, bpy_bmdeformvert_items_doc},
|
||||
{"get", (PyCFunction)bpy_bmdeformvert_get, METH_VARARGS, bpy_bmdeformvert_get_doc},
|
||||
/* BMESH_TODO pop, popitem, update */
|
||||
/* BMESH_TODO `pop`, `popitem`, `update`. */
|
||||
{"clear", (PyCFunction)bpy_bmdeformvert_clear, METH_NOARGS, bpy_bmdeformvert_clear_doc},
|
||||
{NULL, NULL, 0, NULL},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue