diff options
38 files changed, 429 insertions, 180 deletions
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index fe5b179d6d1..99a2cb7966f 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -679,6 +679,7 @@ if(WITH_TBB) set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include) set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR}) if(WITH_TBB_MALLOC_PROXY) + set(TBB_MALLOC_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbbmalloc.lib debug ${LIBDIR}/tbb/lib/tbbmalloc_debug.lib) add_definitions(-DWITH_TBB_MALLOC) endif() endif() diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile index 201d2208486..96eb30a852e 100644 --- a/doc/doxygen/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.16 +# Doxyfile 1.9.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -38,7 +38,7 @@ PROJECT_NAME = Blender # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "V3.0" +PROJECT_NUMBER = V3.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -227,6 +227,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. @@ -263,12 +271,6 @@ TAB_SIZE = 4 ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -309,19 +311,22 @@ OPTIMIZE_OUTPUT_SLICE = NO # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, # Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: # FortranFree, unknown formatted Fortran: Fortran. In the later case the parser # tries to guess whether the code is fixed or free formatted code, this is the -# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is -# Fortran), use: inc=Fortran f=C. +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = @@ -455,6 +460,19 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 3 +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which efficively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -518,6 +536,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -535,8 +560,8 @@ HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO @@ -555,11 +580,18 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = YES -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# (including Cygwin) ands Mac users are advised to set this option to NO. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. # The default value is: system dependent. CASE_SENSE_NAMES = YES @@ -798,7 +830,10 @@ WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. # The default value is: NO. WARN_AS_ERROR = NO @@ -840,8 +875,8 @@ INPUT = doxygen.main.h \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 @@ -854,11 +889,15 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl, +# *.ucf, *.qsf and *.ice. FILE_PATTERNS = @@ -1086,13 +1125,6 @@ VERBATIM_HEADERS = YES ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -1231,9 +1263,9 @@ HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML # documentation will contain a main index with vertical navigation menus that -# are dynamically created via Javascript. If disabled, the navigation index will +# are dynamically created via JavaScript. If disabled, the navigation index will # consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have Javascript, +# page. Disable this option to support browsers that do not have JavaScript, # like the Qt help browser. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1263,10 +1295,11 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/xcode/), introduced with OSX -# 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy # genXcode/_index.html for more information. @@ -1308,8 +1341,8 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# (see: +# https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1339,7 +1372,7 @@ CHM_FILE = blender.chm HHC_LOCATION = "C:/Program Files (x86)/HTML Help Workshop/hhc.exe" # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1384,7 +1417,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1392,8 +1426,8 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1401,16 +1435,16 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = @@ -1422,9 +1456,9 @@ QHP_CUST_FILTER_ATTRS = QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1501,6 +1535,17 @@ TREEVIEW_WIDTH = 246 EXT_LINKS_IN_WINDOW = NO +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1521,8 +1566,14 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1534,7 +1585,7 @@ USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1550,7 +1601,7 @@ MATHJAX_FORMAT = HTML-CSS # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://www.mathjax.org/mathjax @@ -1564,7 +1615,8 @@ MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1592,7 +1644,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1611,7 +1663,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: https://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1624,8 +1677,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: https://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1789,9 +1843,11 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = NO -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -2126,7 +2182,8 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = BUILD_DATE +PREDEFINED = BUILD_DATE \ + DOXYGEN=1 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2303,10 +2360,32 @@ UML_LOOK = YES # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2496,9 +2575,11 @@ DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc and +# plantuml temporary files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 9e237679795..74f2bf7c6ad 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -199,20 +199,6 @@ enum { */ #define G_FILE_FLAG_ALL_RUNTIME (G_FILE_NO_UI | G_FILE_RECOVER_READ | G_FILE_RECOVER_WRITE) -/** ENDIAN_ORDER: indicates what endianness the platform where the file was written had. */ -#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) -# error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined. -#endif - -#define L_ENDIAN 1 -#define B_ENDIAN 0 - -#ifdef __BIG_ENDIAN__ -# define ENDIAN_ORDER B_ENDIAN -#else -# define ENDIAN_ORDER L_ENDIAN -#endif - /** #Global.moving, signals drawing in (3d) window to denote transform */ enum { G_TRANSFORM_OBJ = (1 << 0), diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h index c4af9ab40e2..b28215a72d1 100644 --- a/source/blender/blenkernel/BKE_unit.h +++ b/source/blender/blenkernel/BKE_unit.h @@ -82,12 +82,13 @@ enum { B_UNIT_MASS = 4, B_UNIT_ROTATION = 5, B_UNIT_TIME = 6, - B_UNIT_VELOCITY = 7, - B_UNIT_ACCELERATION = 8, - B_UNIT_CAMERA = 9, - B_UNIT_POWER = 10, - B_UNIT_TEMPERATURE = 11, - B_UNIT_TYPE_TOT = 12, + B_UNIT_TIME_ABSOLUTE = 7, + B_UNIT_VELOCITY = 8, + B_UNIT_ACCELERATION = 9, + B_UNIT_CAMERA = 10, + B_UNIT_POWER = 11, + B_UNIT_TEMPERATURE = 12, + B_UNIT_TYPE_TOT = 13, }; #ifdef __cplusplus diff --git a/source/blender/blenkernel/intern/customdata_file.c b/source/blender/blenkernel/intern/customdata_file.c index 4aaecc26eff..314d5f4ff82 100644 --- a/source/blender/blenkernel/intern/customdata_file.c +++ b/source/blender/blenkernel/intern/customdata_file.c @@ -24,13 +24,13 @@ #include "MEM_guardedalloc.h" +#include "BLI_endian_defines.h" #include "BLI_endian_switch.h" #include "BLI_fileops.h" #include "BLI_string.h" #include "BLI_utildefines.h" #include "BKE_customdata_file.h" -#include "BKE_global.h" /************************* File Format Definitions ***************************/ diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 7832f3cd882..e6ef569d4b9 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -1130,11 +1130,13 @@ static void vgroups_datatransfer_interp(const CustomDataTransferLayerMap *laymap MDeformWeight *dw_dst = BKE_defvert_find_index(data_dst, idx_dst); float weight_src = 0.0f, weight_dst = 0.0f; + bool has_dw_sources = false; if (sources) { for (i = count; i--;) { for (j = data_src[i]->totweight; j--;) { if ((dw_src = &data_src[i]->dw[j])->def_nr == idx_src) { weight_src += dw_src->weight * weights[i]; + has_dw_sources = true; break; } } @@ -1152,7 +1154,14 @@ static void vgroups_datatransfer_interp(const CustomDataTransferLayerMap *laymap CLAMP(weight_src, 0.0f, 1.0f); - if (!dw_dst) { + /* Do not create a destination MDeformWeight data if we had no sources at all. */ + if (!has_dw_sources) { + BLI_assert(weight_src == 0.0f); + if (dw_dst) { + dw_dst->weight = weight_src; + } + } + else if (!dw_dst) { BKE_defvert_add_index_notest(data_dst, idx_dst, weight_src); } else { diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index fec6a7c79a6..a3eb55d8c4a 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -1662,6 +1662,8 @@ const char *nodeStaticSocketType(int type, int subtype) return "NodeSocketFloatAngle"; case PROP_TIME: return "NodeSocketFloatTime"; + case PROP_TIME_ABSOLUTE: + return "NodeSocketFloatTimeAbsolute"; case PROP_DISTANCE: return "NodeSocketFloatDistance"; case PROP_NONE: @@ -1737,6 +1739,8 @@ const char *nodeStaticSocketInterfaceType(int type, int subtype) return "NodeSocketInterfaceFloatAngle"; case PROP_TIME: return "NodeSocketInterfaceFloatTime"; + case PROP_TIME_ABSOLUTE: + return "NodeSocketInterfaceFloatTimeAbsolute"; case PROP_DISTANCE: return "NodeSocketInterfaceFloatDistance"; case PROP_NONE: diff --git a/source/blender/blenkernel/intern/spline_base.cc b/source/blender/blenkernel/intern/spline_base.cc index 4b84f55851b..389420e3ff7 100644 --- a/source/blender/blenkernel/intern/spline_base.cc +++ b/source/blender/blenkernel/intern/spline_base.cc @@ -398,7 +398,7 @@ GVArrayPtr Spline::interpolate_to_evaluated_points(GSpan data) const /** * Sample any input data with a value for each evaluated point (already interpolated to evaluated - * points) to arbitrary parameters in betwen the evaluated points. The interpolation is quite + * points) to arbitrary parameters in between the evaluated points. The interpolation is quite * simple, but this handles the cyclic and end point special cases. */ void Spline::sample_based_on_index_factors(const GVArray &src, diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 3612a26315c..5cf76bb6452 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -358,6 +358,7 @@ static const struct bUnitCollection *bUnitSystems[][B_UNIT_TYPE_TOT] = { NULL, &buNaturalRotCollection, &buNaturalTimeCollection, + &buNaturalTimeCollection, NULL, NULL, NULL, @@ -371,6 +372,7 @@ static const struct bUnitCollection *bUnitSystems[][B_UNIT_TYPE_TOT] = { &buMetricMassCollection, &buNaturalRotCollection, &buNaturalTimeCollection, + &buNaturalTimeCollection, &buMetricVelCollection, &buMetricAclCollection, &buCameraLenCollection, @@ -384,12 +386,13 @@ static const struct bUnitCollection *bUnitSystems[][B_UNIT_TYPE_TOT] = { &buImperialMassCollection, &buNaturalRotCollection, &buNaturalTimeCollection, + &buNaturalTimeCollection, &buImperialVelCollection, &buImperialAclCollection, &buCameraLenCollection, &buPowerCollection, &buImperialTempCollection}, - {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, + {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, }; static const bUnitCollection *unit_get_system(int system, int type) diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 92d19f18a93..560ae30967f 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -36,6 +36,7 @@ # include <AUD_Special.h> # endif +# include "BLI_endian_defines.h" # include "BLI_math_base.h" # include "BLI_threads.h" # include "BLI_utildefines.h" diff --git a/source/blender/blenlib/BLI_endian_defines.h b/source/blender/blenlib/BLI_endian_defines.h new file mode 100644 index 00000000000..31f28572c79 --- /dev/null +++ b/source/blender/blenlib/BLI_endian_defines.h @@ -0,0 +1,38 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#pragma once + +/** \file + * \ingroup bli + */ + +/* NOTE: these names are historic and could use a more generic prefix. + * This could be done as part of a bigger refactor. */ + +/** ENDIAN_ORDER: indicates what endianness the platform where the file was written had. */ +#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +# error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined. +#endif + +#define L_ENDIAN 1 +#define B_ENDIAN 0 + +#ifdef __BIG_ENDIAN__ +# define ENDIAN_ORDER B_ENDIAN +#else +# define ENDIAN_ORDER L_ENDIAN +#endif diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index bf18dd1070e..7cfecc798a7 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -34,6 +34,7 @@ #include <limits.h> /* for PATH_MAX */ #include "BLI_compiler_attrs.h" +#include "BLI_fileops_types.h" #include "BLI_utildefines.h" #ifdef __cplusplus @@ -125,15 +126,20 @@ void BLI_filelist_free(struct direntry *filelist, const unsigned int nrentries); void BLI_filelist_entry_size_to_string(const struct stat *st, const uint64_t sz, const bool compact, - char r_size[]); -void BLI_filelist_entry_mode_to_string( - const struct stat *st, const bool compact, char r_mode1[], char r_mode2[], char r_mode3[]); -void BLI_filelist_entry_owner_to_string(const struct stat *st, const bool compact, char r_owner[]); + char r_size[FILELIST_DIRENTRY_SIZE_LEN]); +void BLI_filelist_entry_mode_to_string(const struct stat *st, + const bool compact, + char r_mode1[FILELIST_DIRENTRY_MODE_LEN], + char r_mode2[FILELIST_DIRENTRY_MODE_LEN], + char r_mode3[FILELIST_DIRENTRY_MODE_LEN]); +void BLI_filelist_entry_owner_to_string(const struct stat *st, + const bool compact, + char r_owner[FILELIST_DIRENTRY_OWNER_LEN]); void BLI_filelist_entry_datetime_to_string(const struct stat *st, const int64_t ts, const bool compact, - char r_time[], - char r_date[], + char r_time[FILELIST_DIRENTRY_TIME_LEN], + char r_date[FILELIST_DIRENTRY_DATE_LEN], bool *r_is_today, bool *r_is_yesterday); diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h index 29fb6a2e233..c11802d6270 100644 --- a/source/blender/blenlib/BLI_mempool.h +++ b/source/blender/blenlib/BLI_mempool.h @@ -68,8 +68,6 @@ typedef struct BLI_mempool_iter { BLI_mempool *pool; struct BLI_mempool_chunk *curchunk; unsigned int curindex; - - struct BLI_mempool_chunk **curchunk_threaded_shared; } BLI_mempool_iter; /* flag */ diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index cf0021609b5..d3000ef38e8 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -542,8 +542,12 @@ void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter) iter->pool = pool; iter->curchunk = pool->chunks; iter->curindex = 0; +} - iter->curchunk_threaded_shared = NULL; +static void mempool_threadsafe_iternew(BLI_mempool *pool, BLI_mempool_threadsafe_iter *ts_iter) +{ + BLI_mempool_iternew(pool, &ts_iter->iter); + ts_iter->curchunk_threaded_shared = NULL; } /** @@ -566,13 +570,13 @@ ParallelMempoolTaskData *mempool_iter_threadsafe_create(BLI_mempool *pool, const ParallelMempoolTaskData *iter_arr = MEM_mallocN(sizeof(*iter_arr) * num_iter, __func__); BLI_mempool_chunk **curchunk_threaded_shared = MEM_mallocN(sizeof(void *), __func__); - BLI_mempool_iternew(pool, &iter_arr->iter); + mempool_threadsafe_iternew(pool, &iter_arr->ts_iter); - *curchunk_threaded_shared = iter_arr->iter.curchunk; - iter_arr->iter.curchunk_threaded_shared = curchunk_threaded_shared; + *curchunk_threaded_shared = iter_arr->ts_iter.iter.curchunk; + iter_arr->ts_iter.curchunk_threaded_shared = curchunk_threaded_shared; for (size_t i = 1; i < num_iter; i++) { - iter_arr[i].iter = iter_arr[0].iter; - *curchunk_threaded_shared = iter_arr[i].iter.curchunk = + iter_arr[i].ts_iter = iter_arr[0].ts_iter; + *curchunk_threaded_shared = iter_arr[i].ts_iter.iter.curchunk = ((*curchunk_threaded_shared) ? (*curchunk_threaded_shared)->next : NULL); } @@ -581,9 +585,9 @@ ParallelMempoolTaskData *mempool_iter_threadsafe_create(BLI_mempool *pool, const void mempool_iter_threadsafe_destroy(ParallelMempoolTaskData *iter_arr) { - BLI_assert(iter_arr->iter.curchunk_threaded_shared != NULL); + BLI_assert(iter_arr->ts_iter.curchunk_threaded_shared != NULL); - MEM_freeN(iter_arr->iter.curchunk_threaded_shared); + MEM_freeN(iter_arr->ts_iter.curchunk_threaded_shared); MEM_freeN(iter_arr); } @@ -604,19 +608,6 @@ static void *bli_mempool_iternext(BLI_mempool_iter *iter) if (iter->curindex == iter->pool->pchunk) { iter->curindex = 0; - if (iter->curchunk_threaded_shared) { - while (1) { - iter->curchunk = *iter->curchunk_threaded_shared; - if (iter->curchunk == NULL) { - return ret; - } - if (atomic_cas_ptr((void **)iter->curchunk_threaded_shared, - iter->curchunk, - iter->curchunk->next) == iter->curchunk) { - break; - } - } - } iter->curchunk = iter->curchunk->next; } @@ -658,19 +649,54 @@ void *BLI_mempool_iterstep(BLI_mempool_iter *iter) } else { iter->curindex = 0; - if (iter->curchunk_threaded_shared) { - for (iter->curchunk = *iter->curchunk_threaded_shared; - (iter->curchunk != NULL) && (atomic_cas_ptr((void **)iter->curchunk_threaded_shared, - iter->curchunk, - iter->curchunk->next) != iter->curchunk); - iter->curchunk = *iter->curchunk_threaded_shared) { - /* pass. */ - } - - if (UNLIKELY(iter->curchunk == NULL)) { - return (ret->freeword == FREEWORD) ? NULL : ret; - } + iter->curchunk = iter->curchunk->next; + if (UNLIKELY(iter->curchunk == NULL)) { + return (ret->freeword == FREEWORD) ? NULL : ret; + } + curnode = CHUNK_DATA(iter->curchunk); + } + } while (ret->freeword == FREEWORD); + + return ret; +} + +/** + * A version of #BLI_mempool_iterstep that uses + * #BLI_mempool_threadsafe_iter.curchunk_threaded_shared for threaded iteration support. + * (threaded section noted in comments). + */ +void *mempool_iter_threadsafe_step(BLI_mempool_threadsafe_iter *ts_iter) +{ + BLI_mempool_iter *iter = &ts_iter->iter; + if (UNLIKELY(iter->curchunk == NULL)) { + return NULL; + } + + const uint esize = iter->pool->esize; + BLI_freenode *curnode = POINTER_OFFSET(CHUNK_DATA(iter->curchunk), (esize * iter->curindex)); + BLI_freenode *ret; + do { + ret = curnode; + + if (++iter->curindex != iter->pool->pchunk) { + curnode = POINTER_OFFSET(curnode, esize); + } + else { + iter->curindex = 0; + + /* Begin unique to the `threadsafe` version of this function. */ + for (iter->curchunk = *ts_iter->curchunk_threaded_shared; + (iter->curchunk != NULL) && (atomic_cas_ptr((void **)ts_iter->curchunk_threaded_shared, + iter->curchunk, + iter->curchunk->next) != iter->curchunk); + iter->curchunk = *ts_iter->curchunk_threaded_shared) { + /* pass. */ } + if (UNLIKELY(iter->curchunk == NULL)) { + return (ret->freeword == FREEWORD) ? NULL : ret; + } + /* End `threadsafe` exception. */ + iter->curchunk = iter->curchunk->next; if (UNLIKELY(iter->curchunk == NULL)) { return (ret->freeword == FREEWORD) ? NULL : ret; diff --git a/source/blender/blenlib/intern/BLI_mempool_private.h b/source/blender/blenlib/intern/BLI_mempool_private.h index 60994624ecd..e1c8205c80c 100644 --- a/source/blender/blenlib/intern/BLI_mempool_private.h +++ b/source/blender/blenlib/intern/BLI_mempool_private.h @@ -31,8 +31,13 @@ #include "BLI_mempool.h" #include "BLI_task.h" -typedef struct ParallelMempoolTaskData { +typedef struct BLI_mempool_threadsafe_iter { BLI_mempool_iter iter; + struct BLI_mempool_chunk **curchunk_threaded_shared; +} BLI_mempool_threadsafe_iter; + +typedef struct ParallelMempoolTaskData { + BLI_mempool_threadsafe_iter ts_iter; TaskParallelTLS tls; } ParallelMempoolTaskData; @@ -40,6 +45,8 @@ ParallelMempoolTaskData *mempool_iter_threadsafe_create(BLI_mempool *pool, const ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); void mempool_iter_threadsafe_destroy(ParallelMempoolTaskData *iter_arr) ATTR_NONNULL(); +void *mempool_iter_threadsafe_step(BLI_mempool_threadsafe_iter *iter); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 5f823396ed9..8964dac31a9 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -293,7 +293,7 @@ bool BLI_file_alias_target(const char *filepath, /* This parameter can only be `const` on Linux since * redirections are not supported there. * NOLINTNEXTLINE: readability-non-const-parameter. */ - char r_targetpath[FILE_MAXDIR]) + char r_targetpath[/*FILE_MAXDIR*/]) { # ifdef WIN32 if (!BLI_path_extension_check(filepath, ".lnk")) { diff --git a/source/blender/blenlib/intern/task_iterator.c b/source/blender/blenlib/intern/task_iterator.c index c45cc2b18b8..ee41c277b34 100644 --- a/source/blender/blenlib/intern/task_iterator.c +++ b/source/blender/blenlib/intern/task_iterator.c @@ -379,11 +379,11 @@ typedef struct ParallelMempoolState { static void parallel_mempool_func(TaskPool *__restrict pool, void *taskdata) { ParallelMempoolState *__restrict state = BLI_task_pool_user_data(pool); - BLI_mempool_iter *iter = &((ParallelMempoolTaskData *)taskdata)->iter; + BLI_mempool_threadsafe_iter *iter = &((ParallelMempoolTaskData *)taskdata)->ts_iter; TaskParallelTLS *tls = &((ParallelMempoolTaskData *)taskdata)->tls; MempoolIterData *item; - while ((item = BLI_mempool_iterstep(iter)) != NULL) { + while ((item = mempool_iter_threadsafe_step(iter)) != NULL) { state->func(state->userdata, item, tls); } } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 801f5864c8d..47ed4e5c06f 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -62,6 +62,7 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" +#include "BLI_endian_defines.h" #include "BLI_endian_switch.h" #include "BLI_ghash.h" #include "BLI_linklist.h" diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 4ac49d5aebb..38c00b3f132 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -100,6 +100,7 @@ #include "BLI_bitmap.h" #include "BLI_blenlib.h" +#include "BLI_endian_defines.h" #include "BLI_mempool.h" #include "MEM_guardedalloc.h" /* MEM_freeN */ diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index 57de62e1880..aab4c3ca0f6 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -168,7 +168,7 @@ ViewLayer *DEG_get_evaluated_view_layer(const Depsgraph *graph) const deg::Depsgraph *deg_graph = reinterpret_cast<const deg::Depsgraph *>(graph); Scene *scene_cow = DEG_get_evaluated_scene(graph); if (scene_cow == nullptr) { - return nullptr; /* Happens with new, not-yet-built/evaluated graphes. */ + return nullptr; /* Happens with new, not-yet-built/evaluated graphs. */ } /* Do name-based lookup. */ /* TODO(sergey): Can this be optimized? */ diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 8370bf6593e..f29f5187015 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -2779,7 +2779,7 @@ void GPENCIL_OT_dissolve(wmOperatorType *ot) /* Poll callback for snap operators */ /* NOTE: For now, we only allow these in the 3D view, as other editors do not - * define a cursor or gridstep which can be used + * define a cursor or grid-step which can be used. */ static bool gpencil_snap_poll(bContext *C) { diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index f03eeeb3c75..41db79bc134 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -300,7 +300,7 @@ typedef struct ProjPaintState { /** Calculated from screenMin & screenMax. */ float screen_width; float screen_height; - /** from the carea or from the projection render. */ + /** From the area or from the projection render. */ int winx, winy; /* options for projection painting */ diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 0c97fdc1c18..4a070590d55 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -154,7 +154,9 @@ void OUTLINER_OT_highlight_update(wmOperatorType *ot) /** \name Toggle Open/Closed Operator * \{ */ -/* Open or close a tree element, optionally toggling all children recursively */ +/** + * Open or close a tree element, optionally toggling all children recursively. + */ void outliner_item_openclose(SpaceOutliner *space_outliner, TreeElement *te, bool open, @@ -1599,8 +1601,10 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot) /** \name Show Hierarchy Operator * \{ */ -/* Helper function for tree_element_shwo_hierarchy() - - * recursively checks whether subtrees have any objects. */ +/** + * Helper function for #tree_element_shwo_hierarchy() - + * recursively checks whether subtrees have any objects. + */ static int subtree_has_objects(ListBase *lb) { LISTBASE_FOREACH (TreeElement *, te, lb) { diff --git a/source/blender/functions/FN_cpp_type.hh b/source/blender/functions/FN_cpp_type.hh index cd1597a742c..14eab2704e9 100644 --- a/source/blender/functions/FN_cpp_type.hh +++ b/source/blender/functions/FN_cpp_type.hh @@ -260,6 +260,11 @@ class CPPType : NonCopyable, NonMovable { return !(&a == &b); } + /** + * Get the `CPPType` that corresponds to a specific static type. + * This only works for types that actually implement the template specialization using + * `MAKE_CPP_TYPE`. + */ template<typename T> static const CPPType &get(); /** diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 58357e52149..4d116eb73b8 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -24,6 +24,7 @@ #include "MEM_guardedalloc.h" +#include "BLI_endian_defines.h" #include "BLI_endian_switch.h" #include "BLI_fileops.h" #include "BLI_ghash.h" @@ -40,8 +41,6 @@ #include "IMB_indexer.h" #include "imbuf.h" -#include "BKE_global.h" - #ifdef WITH_AVI # include "AVI_avi.h" #endif diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 12f7553d5e4..d9e1db27ef0 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -38,6 +38,7 @@ #include "imbuf.h" +#include "BLI_endian_defines.h" #include "BLI_math.h" #include "BLI_utildefines.h" diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 4a6d6dddec7..8e1cfafcc42 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -82,17 +82,18 @@ typedef enum PropertyType { /* also update rna_property_subtype_unit when you change this */ typedef enum PropertyUnit { PROP_UNIT_NONE = (0 << 16), - PROP_UNIT_LENGTH = (1 << 16), /* m */ - PROP_UNIT_AREA = (2 << 16), /* m^2 */ - PROP_UNIT_VOLUME = (3 << 16), /* m^3 */ - PROP_UNIT_MASS = (4 << 16), /* kg */ - PROP_UNIT_ROTATION = (5 << 16), /* radians */ - PROP_UNIT_TIME = (6 << 16), /* frame */ - PROP_UNIT_VELOCITY = (7 << 16), /* m/s */ - PROP_UNIT_ACCELERATION = (8 << 16), /* m/(s^2) */ - PROP_UNIT_CAMERA = (9 << 16), /* mm */ - PROP_UNIT_POWER = (10 << 16), /* W */ - PROP_UNIT_TEMPERATURE = (11 << 16), /* C */ + PROP_UNIT_LENGTH = (1 << 16), /* m */ + PROP_UNIT_AREA = (2 << 16), /* m^2 */ + PROP_UNIT_VOLUME = (3 << 16), /* m^3 */ + PROP_UNIT_MASS = (4 << 16), /* kg */ + PROP_UNIT_ROTATION = (5 << 16), /* radians */ + PROP_UNIT_TIME = (6 << 16), /* frame */ + PROP_UNIT_TIME_ABSOLUTE = (7 << 16), /* time in seconds (independent of scene) */ + PROP_UNIT_VELOCITY = (8 << 16), /* m/s */ + PROP_UNIT_ACCELERATION = (9 << 16), /* m/(s^2) */ + PROP_UNIT_CAMERA = (10 << 16), /* mm */ + PROP_UNIT_POWER = (11 << 16), /* W */ + PROP_UNIT_TEMPERATURE = (12 << 16), /* C */ } PropertyUnit; /** @@ -157,6 +158,7 @@ typedef enum PropertySubType { PROP_FACTOR = 15, PROP_ANGLE = 16 | PROP_UNIT_ROTATION, PROP_TIME = 17 | PROP_UNIT_TIME, + PROP_TIME_ABSOLUTE = 17 | PROP_UNIT_TIME_ABSOLUTE, /** Distance in 3d space, don't use for pixel distance for eg. */ PROP_DISTANCE = 18 | PROP_UNIT_LENGTH, PROP_DISTANCE_CAMERA = 19 | PROP_UNIT_CAMERA, diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index efe12114d55..7a9cfa79324 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -3201,6 +3201,8 @@ static const char *rna_property_subtypename(PropertySubType type) return "PROP_ANGLE"; case PROP_TIME: return "PROP_TIME"; + case PROP_TIME_ABSOLUTE: + return "PROP_TIME_ABSOLUTE"; case PROP_DISTANCE: return "PROP_DISTANCE"; case PROP_DISTANCE_CAMERA: @@ -3266,6 +3268,8 @@ static const char *rna_property_subtype_unit(PropertySubType type) return "PROP_UNIT_ROTATION"; case PROP_UNIT_TIME: return "PROP_UNIT_TIME"; + case PROP_UNIT_TIME_ABSOLUTE: + return "PROP_UNIT_TIME_ABSOLUTE"; case PROP_UNIT_VELOCITY: return "PROP_UNIT_VELOCITY"; case PROP_UNIT_ACCELERATION: diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 50c38645ee6..17d60de9c1b 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1985,7 +1985,9 @@ static bool switch_type_supported(const EnumPropertyItem *item) SOCK_RGBA, SOCK_GEOMETRY, SOCK_OBJECT, - SOCK_COLLECTION); + SOCK_COLLECTION, + SOCK_TEXTURE, + SOCK_MATERIAL); } static const EnumPropertyItem *rna_GeometryNodeSwitch_type_itemf(bContext *UNUSED(C), @@ -10870,6 +10872,8 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) rna_def_node_socket_float( brna, "NodeSocketFloatTime", "NodeSocketInterfaceFloatTime", PROP_TIME); rna_def_node_socket_float( + brna, "NodeSocketFloatTimeAbsolute", "NodeSocketInterfaceFloatTimeAbsolute", PROP_TIME_ABSOLUTE); + rna_def_node_socket_float( brna, "NodeSocketFloatDistance", "NodeSocketInterfaceFloatDistance", PROP_DISTANCE); rna_def_node_socket_int(brna, "NodeSocketInt", "NodeSocketInterfaceInt", PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index f7a7b745493..9e7d0f99dfa 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -81,7 +81,16 @@ const EnumPropertyItem rna_enum_property_subtype_items[] = { {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""}, {PROP_FACTOR, "FACTOR", 0, "Factor", ""}, {PROP_ANGLE, "ANGLE", 0, "Angle", ""}, - {PROP_TIME, "TIME", 0, "Time", ""}, + {PROP_TIME, + "TIME", + 0, + "Time (Scene Relative)", + "Time specified in frames, converted to seconds based on scene frame rate"}, + {PROP_TIME_ABSOLUTE, + "TIME_ABSOLUTE", + 0, + "Time (Absolute)", + "Time specified in seconds, independent of the scene"}, {PROP_DISTANCE, "DISTANCE", 0, "Distance", ""}, {PROP_DISTANCE_CAMERA, "DISTANCE_CAMERA", 0, "Camera Distance", ""}, {PROP_POWER, "POWER", 0, "Power", ""}, diff --git a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc index 7f80afde99b..5f82cd9ba27 100644 --- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc +++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc @@ -1282,7 +1282,7 @@ class GeometryNodesEvaluator { GMutablePointer value = this->get_value_from_socket(origin_socket, *input_state.type); if (input_socket->is_multi_input_socket()) { MultiInputValue &multi_value = *input_state.value.multi; - multi_value.items.append({input_socket, value.get()}); + multi_value.items.append({origin_socket, value.get()}); } else { SingleInputValue &single_value = *input_state.value.single; diff --git a/source/blender/nodes/geometry/nodes/node_geo_switch.cc b/source/blender/nodes/geometry/nodes/node_geo_switch.cc index 742fafba9e6..0aa5c68aaf5 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_switch.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_switch.cc @@ -40,6 +40,10 @@ static bNodeSocketTemplate geo_node_switch_in[] = { {SOCK_OBJECT, N_("True")}, {SOCK_COLLECTION, N_("False")}, {SOCK_COLLECTION, N_("True")}, + {SOCK_TEXTURE, N_("False")}, + {SOCK_TEXTURE, N_("True")}, + {SOCK_MATERIAL, N_("False")}, + {SOCK_MATERIAL, N_("True")}, {-1, ""}, }; @@ -53,6 +57,8 @@ static bNodeSocketTemplate geo_node_switch_out[] = { {SOCK_GEOMETRY, N_("Output")}, {SOCK_OBJECT, N_("Output")}, {SOCK_COLLECTION, N_("Output")}, + {SOCK_TEXTURE, N_("Output")}, + {SOCK_MATERIAL, N_("Output")}, {-1, ""}, }; @@ -153,6 +159,14 @@ static void geo_node_switch_exec(GeoNodeExecParams params) output_input<Collection *>(params, input, "_008", "Output_008"); break; } + case SOCK_TEXTURE: { + output_input<Tex *>(params, input, "_009", "Output_009"); + break; + } + case SOCK_MATERIAL: { + output_input<Material *>(params, input, "_010", "Output_010"); + break; + } default: BLI_assert_unreachable(); break; diff --git a/source/blender/nodes/intern/node_socket.cc b/source/blender/nodes/intern/node_socket.cc index 052896d2f48..d00bf636e15 100644 --- a/source/blender/nodes/intern/node_socket.cc +++ b/source/blender/nodes/intern/node_socket.cc @@ -727,6 +727,7 @@ void register_standard_node_socket_types(void) nodeRegisterSocketType(make_socket_type_float(PROP_FACTOR)); nodeRegisterSocketType(make_socket_type_float(PROP_ANGLE)); nodeRegisterSocketType(make_socket_type_float(PROP_TIME)); + nodeRegisterSocketType(make_socket_type_float(PROP_TIME_ABSOLUTE)); nodeRegisterSocketType(make_socket_type_float(PROP_DISTANCE)); nodeRegisterSocketType(make_socket_type_int(PROP_NONE)); diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index fc6536be88d..638975f8fba 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -1065,26 +1065,18 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args) Py_RETURN_NONE; } -PyDoc_STRVAR( - bpy_bmesh_from_object_doc, - ".. method:: from_object(object, depsgraph, deform=True, cage=False, face_normals=True)\n" - "\n" - " Initialize this bmesh from existing object datablock (currently only meshes are " - "supported).\n" - "\n" - " :arg object: The object data to load.\n" - " :type object: :class:`Object`\n" - " :arg deform: Apply deformation modifiers.\n" - " :type deform: boolean\n" - " :arg cage: Get the mesh as a deformed cage.\n" - " :type cage: boolean\n" - " :arg face_normals: Calculate face normals.\n" - " :type face_normals: boolean\n" - "\n" - " .. deprecated:: 2.93\n" - "\n" - " The deform parameter is deprecated, assumed to be True, and will be removed in version " - "3.0.\n"); +PyDoc_STRVAR(bpy_bmesh_from_object_doc, + ".. method:: from_object(object, depsgraph, cage=False, face_normals=True)\n" + "\n" + " Initialize this bmesh from existing object data-block (only meshes are currently " + "supported).\n" + "\n" + " :arg object: The object data to load.\n" + " :type object: :class:`Object`\n" + " :arg cage: Get the mesh as a deformed cage.\n" + " :type cage: boolean\n" + " :arg face_normals: Calculate face normals.\n" + " :type face_normals: boolean\n"); static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject *kw) { static const char *kwlist[] = {"object", "depsgraph", "cage", "face_normals", NULL}; diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index c21c635913f..6ad80f9160b 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -147,7 +147,17 @@ static const EnumPropertyItem property_subtype_number_items[] = { {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""}, {PROP_FACTOR, "FACTOR", 0, "Factor", ""}, {PROP_ANGLE, "ANGLE", 0, "Angle", ""}, - {PROP_TIME, "TIME", 0, "Time", ""}, + {PROP_TIME, + "TIME", + 0, + "Time (Scene Relative)", + "Time specified in frames, converted to seconds based on scene frame rate"}, + {PROP_TIME_ABSOLUTE, + "TIME_ABSOLUTE", + 0, + "Time (Absolute)", + "Time specified in seconds, independent of the scene"}, + {PROP_TIME_ABSOLUTE, "TIME_ABSOLUTE", 0, "Time Absolute", ""}, {PROP_DISTANCE, "DISTANCE", 0, "Distance", ""}, {PROP_DISTANCE_CAMERA, "DISTANCE_CAMERA", 0, "Camera Distance", ""}, {PROP_POWER, "POWER", 0, "Power", ""}, diff --git a/source/blender/sequencer/intern/image_cache.c b/source/blender/sequencer/intern/image_cache.c index 5ccf2a027b0..a6e4b6ea7ed 100644 --- a/source/blender/sequencer/intern/image_cache.c +++ b/source/blender/sequencer/intern/image_cache.c @@ -35,6 +35,7 @@ #include "IMB_imbuf_types.h" #include "BLI_blenlib.h" +#include "BLI_endian_defines.h" #include "BLI_endian_switch.h" #include "BLI_fileops.h" #include "BLI_fileops_types.h" @@ -44,7 +45,6 @@ #include "BLI_path_util.h" #include "BLI_threads.h" -#include "BKE_global.h" #include "BKE_main.h" #include "BKE_scene.h" diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 519b3781103..39bf2f1e32d 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -116,6 +116,7 @@ if(WITH_XR_OPENXR) endif() if(WITH_GMP) + blender_include_dirs(${GMP_INCLUDE_DIRS}) add_definitions(-DWITH_GMP) endif() @@ -909,6 +910,7 @@ elseif(WIN32) DESTINATION "." CONFIGURATIONS Debug ) + list(APPEND LIB ${TBB_MALLOC_LIBRARIES}) endif() if(WITH_CODEC_SNDFILE) diff --git a/source/creator/creator.c b/source/creator/creator.c index 51efadf5e56..2ec4a2aa616 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -210,6 +210,41 @@ char **environ = NULL; /** \} */ /* -------------------------------------------------------------------- */ +/** \name GMP Allocator Workaround + * \{ */ + +#if (defined(WITH_TBB_MALLOC) && defined(_MSC_VER) && defined(NDEBUG) && defined(WITH_GMP)) || \ + defined(DOXYGEN) +# include "gmp.h" +# include "tbb/scalable_allocator.h" + +void *gmp_alloc(size_t size) +{ + return scalable_malloc(size); +} +void *gmp_realloc(void *ptr, size_t old_size, size_t new_size) +{ + return scalable_realloc(ptr, new_size); +} + +void gmp_free(void *ptr, size_t size) +{ + scalable_free(ptr); +} +/** + * Use TBB's scalable_allocator on Windows. + * `TBBmalloc` correctly captures all allocations already, + * however, GMP is built with MINGW since it doesn't build with MSVC, + * which TBB has issues hooking into automatically. + */ +void gmp_blender_init_allocator() +{ + mp_set_memory_functions(gmp_alloc, gmp_realloc, gmp_free); +} +#endif +/** \} */ + +/* -------------------------------------------------------------------- */ /** \name Main Function * \{ */ @@ -342,6 +377,10 @@ int main(int argc, CCL_init_logging(argv[0]); #endif +#if defined(WITH_TBB_MALLOC) && defined(_MSC_VER) && defined(NDEBUG) && defined(WITH_GMP) + gmp_blender_init_allocator(); +#endif + main_callback_setup(); #if defined(__APPLE__) && !defined(WITH_PYTHON_MODULE) && !defined(WITH_HEADLESS) |