2023-05-31 16:19:06 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup DNA
|
2011-02-17 21:48:12 +01:00
|
|
|
*/
|
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#pragma once
|
2011-12-30 08:25:49 +01:00
|
|
|
|
2011-12-04 07:05:48 +01:00
|
|
|
#include "DNA_defs.h"
|
|
|
|
|
2023-02-09 01:30:25 +01:00
|
|
|
/* XXX(@ideasman42): temp feature. */
|
2009-12-16 20:49:33 +01:00
|
|
|
#define DURIAN_CAMERA_SWITCH
|
|
|
|
|
2022-09-28 01:41:31 +02:00
|
|
|
/**
|
|
|
|
* Check for cyclic set-scene.
|
2023-02-12 04:37:16 +01:00
|
|
|
* Libraries can cause this case which is normally prevented, see (#42009).
|
2022-09-28 01:41:31 +02:00
|
|
|
*/
|
2020-11-06 15:21:45 +01:00
|
|
|
#define USE_SETSCENE_CHECK
|
|
|
|
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_ID.h"
|
2020-12-15 00:47:58 +01:00
|
|
|
#include "DNA_color_types.h" /* color management */
|
2021-10-18 02:16:24 +02:00
|
|
|
#include "DNA_customdata_types.h" /* Scene's runtime custom-data masks. */
|
Render Layers and Collections (merge from render-layers)
Design Documents
----------------
* https://wiki.blender.org/index.php/Dev:2.8/Source/Layers
* https://wiki.blender.org/index.php/Dev:2.8/Source/DataDesignRevised
User Commit Log
---------------
* New Layer and Collection system to replace render layers and viewport layers.
* A layer is a set of collections of objects (and their drawing options) required for specific tasks.
* A collection is a set of objects, equivalent of the old layers in Blender. A collection can be shared across multiple layers.
* All Scenes have a master collection that all other collections are children of.
* New collection "context" tab (in Properties Editor)
* New temporary viewport "collections" panel to control per-collection
visibility
Missing User Features
---------------------
* Collection "Filter"
Option to add objects based on their names
* Collection Manager operators
The existing buttons are placeholders
* Collection Manager drawing
The editor main region is empty
* Collection Override
* Per-Collection engine settings
This will come as a separate commit, as part of the clay-engine branch
Dev Commit Log
--------------
* New DNA file (DNA_layer_types.h) with the new structs
We are replacing Base by a new extended Base while keeping it backward
compatible with some legacy settings (i.e., lay, flag_legacy).
Renamed all Base to BaseLegacy to make it clear the areas of code that
still need to be converted
Note: manual changes were required on - deg_builder_nodes.h, rna_object.c, KX_Light.cpp
* Unittesting for main syncronization requirements
- read, write, add/copy/remove objects, copy scene, collection
link/unlinking, context)
* New Editor: Collection Manager
Based on patch by Julian Eisel
This is extracted from the layer-manager branch. With the following changes:
- Renamed references of layer manager to collections manager
- I doesn't include the editors/space_collections/ draw and util files
- The drawing code itself will be implemented separately by Julian
* Base / Object:
A little note about them. Original Blender code would try to keep them
in sync through the code, juggling flags back and forth. This will now
be handled by Depsgraph, keeping Object and Bases more separated
throughout the non-rendering code.
Scene.base is being cleared in doversion, and the old viewport drawing
code was poorly converted to use the new bases while the new viewport
code doesn't get merged and replace the old one.
Python API Changes
------------------
```
- scene.layers
+ # no longer exists
- scene.objects
+ scene.scene_layers.active.objects
- scene.objects.active
+ scene.render_layers.active.objects.active
- bpy.context.scene.objects.link()
+ bpy.context.scene_collection.objects.link()
- bpy_extras.object_utils.object_data_add(context, obdata, operator=None, use_active_layer=True, name=None)
+ bpy_extras.object_utils.object_data_add(context, obdata, operator=None, name=None)
- bpy.context.object.select
+ bpy.context.object.select = True
+ bpy.context.object.select = False
+ bpy.context.object.select_get()
+ bpy.context.object.select_set(action='SELECT')
+ bpy.context.object.select_set(action='DESELECT')
-AddObjectHelper.layers
+ # no longer exists
```
2017-02-07 10:18:38 +01:00
|
|
|
#include "DNA_layer_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_listBase.h"
|
2023-05-08 23:48:38 +02:00
|
|
|
#include "DNA_scene_enums.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_vec_types.h"
|
2018-05-08 14:18:09 +02:00
|
|
|
#include "DNA_view3d_types.h"
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2019-01-28 11:08:24 +01:00
|
|
|
struct AnimData;
|
2010-08-04 06:01:27 +02:00
|
|
|
struct Brush;
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
struct Collection;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct ColorSpace;
|
|
|
|
struct CurveMapping;
|
2019-11-20 22:12:32 +01:00
|
|
|
struct CurveProfile;
|
Refactor CDData masks, to have one mask per mesh elem type.
We already have different storages for cddata of verts, edges etc.,
'simply' do the same for the mask flags we use all around Blender code
to request some data, or limit some operation to some layers, etc.
Reason we need this is that some cddata types (like Normals) are
actually shared between verts/polys/loops, and we don’t want to generate
clnors everytime we request vnors!
As a side note, this also does final fix to T59338, which was the
trigger for this patch (need to request computed loop normals for
another mesh than evaluated one).
Reviewers: brecht, campbellbarton, sergey
Differential Revision: https://developer.blender.org/D4407
2019-03-07 11:13:40 +01:00
|
|
|
struct CustomData_MeshMasks;
|
2009-09-19 00:25:49 +02:00
|
|
|
struct Editing;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct Image;
|
2011-11-07 13:55:18 +01:00
|
|
|
struct MovieClip;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct Object;
|
|
|
|
struct Scene;
|
|
|
|
struct World;
|
|
|
|
struct bGPdata;
|
|
|
|
struct bNodeTree;
|
2009-08-04 02:40:36 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name FFMPEG
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct AviCodecData {
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Save format. */
|
|
|
|
void *lpFormat;
|
|
|
|
/** Compressor options. */
|
|
|
|
void *lpParms;
|
|
|
|
/** Size of lpFormat buffer. */
|
|
|
|
unsigned int cbFormat;
|
|
|
|
/** Size of lpParms buffer. */
|
|
|
|
unsigned int cbParms;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Stream type, for consistency. */
|
|
|
|
unsigned int fccType;
|
|
|
|
/** Compressor. */
|
|
|
|
unsigned int fccHandler;
|
|
|
|
/** Keyframe rate. */
|
|
|
|
unsigned int dwKeyFrameEvery;
|
|
|
|
/** Compress quality 0-10,000. */
|
|
|
|
unsigned int dwQuality;
|
|
|
|
/** Bytes per second. */
|
|
|
|
unsigned int dwBytesPerSecond;
|
|
|
|
/** Flags... see below. */
|
|
|
|
unsigned int dwFlags;
|
|
|
|
/** For non-video streams only. */
|
|
|
|
unsigned int dwInterleaveEvery;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad[4];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2003-05-11 17:44:23 +02:00
|
|
|
char avicodecname[128];
|
2002-10-12 13:37:38 +02:00
|
|
|
} AviCodecData;
|
|
|
|
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum eFFMpegPreset {
|
2020-04-24 07:49:25 +02:00
|
|
|
FFM_PRESET_NONE = 0,
|
FFmpeg interface improvements
This patch changes a couple of things in the video output encoding.
{F362527}
- Clearer separation between container and codec. No more "format", as this is
too ambiguous. As a result, codecs were removed from the container list.
- Added FFmpeg speed presets, so the user can choosen from the range "Very
slow" to "Ultra fast". By default no preset is used.
- Added Constant Rate Factor (CRF) mode, which allows changing the bit-rate
depending on the desired quality and the input. This generally produces the
best quality videos, at the expense of not knowing the exact bit-rate and
file size.
- Added optional maximum of non-B-frames between B-frames (`max_b_frames`).
- Presets were adjusted for these changes, and new presets added. One of the
new presets is [recommended](https://trac.ffmpeg.org/wiki/Encode/VFX#H.264)
for reviewing videos, as it allows players to scrub through it easily. Might
be nice in weeklies. This preset also requires control over the
`max_b_frames` setting.
GUI-only changes:
- Renamed "MPEG" in the output file format menu with "FFmpeg", as this is more
accurate. After all, FFmpeg is used when this option is chosen, which can
also output non-MPEG files.
- Certain parts of the GUI are disabled when not in use:
- bit rate options are not used when a constant rate factor is given.
- audio bitrate & volume are not used when no audio is exported.
Note that I did not touch `BKE_ffmpeg_preset_set()`. There are currently two
preset systems for FFmpeg (`BKE_ffmpeg_preset_set()` and the Python preset
system). Before we do more work on `BKE_ffmpeg_preset_set()`, I think it's a
good idea to determine whether we want to keep it at all.
After this patch has been accepted, I'd be happy to go through the code and
remove any then-obsolete bits, such as the handling of "XVID" as a container
format.
Reviewers: sergey, mont29, brecht
Subscribers: mpan3, Blendify, brecht, fsiddi
Tags: #bf_blender
Differential Revision: https://developer.blender.org/D2242
2016-09-21 15:01:51 +02:00
|
|
|
|
2019-12-16 23:42:12 +01:00
|
|
|
#ifdef DNA_DEPRECATED_ALLOW
|
2018-04-09 15:27:11 +02:00
|
|
|
/* Previously used by h.264 to control encoding speed vs. file size. */
|
2020-04-24 07:49:25 +02:00
|
|
|
FFM_PRESET_ULTRAFAST = 1, /* DEPRECATED */
|
|
|
|
FFM_PRESET_SUPERFAST = 2, /* DEPRECATED */
|
|
|
|
FFM_PRESET_VERYFAST = 3, /* DEPRECATED */
|
|
|
|
FFM_PRESET_FASTER = 4, /* DEPRECATED */
|
|
|
|
FFM_PRESET_FAST = 5, /* DEPRECATED */
|
|
|
|
FFM_PRESET_MEDIUM = 6, /* DEPRECATED */
|
|
|
|
FFM_PRESET_SLOW = 7, /* DEPRECATED */
|
|
|
|
FFM_PRESET_SLOWER = 8, /* DEPRECATED */
|
|
|
|
FFM_PRESET_VERYSLOW = 9, /* DEPRECATED */
|
2018-04-09 15:27:11 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Used by WEBM/VP9 and h.264 to control encoding speed vs. file size.
|
|
|
|
* WEBM/VP9 use these values directly, whereas h.264 map those to
|
2022-12-15 00:31:18 +01:00
|
|
|
* respectively the MEDIUM, SLOWER, and SUPERFAST presets. */
|
|
|
|
|
|
|
|
/** The default and recommended for most applications. */
|
2019-01-15 13:14:35 +01:00
|
|
|
FFM_PRESET_GOOD = 10,
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Recommended if you have lots of time and want the best compression efficiency. */
|
2020-04-24 07:49:25 +02:00
|
|
|
FFM_PRESET_BEST = 11,
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Recommended for live / fast encoding. */
|
2020-04-24 07:49:25 +02:00
|
|
|
FFM_PRESET_REALTIME = 12,
|
2018-04-09 15:27:11 +02:00
|
|
|
} eFFMpegPreset;
|
FFmpeg interface improvements
This patch changes a couple of things in the video output encoding.
{F362527}
- Clearer separation between container and codec. No more "format", as this is
too ambiguous. As a result, codecs were removed from the container list.
- Added FFmpeg speed presets, so the user can choosen from the range "Very
slow" to "Ultra fast". By default no preset is used.
- Added Constant Rate Factor (CRF) mode, which allows changing the bit-rate
depending on the desired quality and the input. This generally produces the
best quality videos, at the expense of not knowing the exact bit-rate and
file size.
- Added optional maximum of non-B-frames between B-frames (`max_b_frames`).
- Presets were adjusted for these changes, and new presets added. One of the
new presets is [recommended](https://trac.ffmpeg.org/wiki/Encode/VFX#H.264)
for reviewing videos, as it allows players to scrub through it easily. Might
be nice in weeklies. This preset also requires control over the
`max_b_frames` setting.
GUI-only changes:
- Renamed "MPEG" in the output file format menu with "FFmpeg", as this is more
accurate. After all, FFmpeg is used when this option is chosen, which can
also output non-MPEG files.
- Certain parts of the GUI are disabled when not in use:
- bit rate options are not used when a constant rate factor is given.
- audio bitrate & volume are not used when no audio is exported.
Note that I did not touch `BKE_ffmpeg_preset_set()`. There are currently two
preset systems for FFmpeg (`BKE_ffmpeg_preset_set()` and the Python preset
system). Before we do more work on `BKE_ffmpeg_preset_set()`, I think it's a
good idea to determine whether we want to keep it at all.
After this patch has been accepted, I'd be happy to go through the code and
remove any then-obsolete bits, such as the handling of "XVID" as a container
format.
Reviewers: sergey, mont29, brecht
Subscribers: mpan3, Blendify, brecht, fsiddi
Tags: #bf_blender
Differential Revision: https://developer.blender.org/D2242
2016-09-21 15:01:51 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
|
|
|
* Mapping from easily-understandable descriptions to CRF values.
|
FFmpeg interface improvements
This patch changes a couple of things in the video output encoding.
{F362527}
- Clearer separation between container and codec. No more "format", as this is
too ambiguous. As a result, codecs were removed from the container list.
- Added FFmpeg speed presets, so the user can choosen from the range "Very
slow" to "Ultra fast". By default no preset is used.
- Added Constant Rate Factor (CRF) mode, which allows changing the bit-rate
depending on the desired quality and the input. This generally produces the
best quality videos, at the expense of not knowing the exact bit-rate and
file size.
- Added optional maximum of non-B-frames between B-frames (`max_b_frames`).
- Presets were adjusted for these changes, and new presets added. One of the
new presets is [recommended](https://trac.ffmpeg.org/wiki/Encode/VFX#H.264)
for reviewing videos, as it allows players to scrub through it easily. Might
be nice in weeklies. This preset also requires control over the
`max_b_frames` setting.
GUI-only changes:
- Renamed "MPEG" in the output file format menu with "FFmpeg", as this is more
accurate. After all, FFmpeg is used when this option is chosen, which can
also output non-MPEG files.
- Certain parts of the GUI are disabled when not in use:
- bit rate options are not used when a constant rate factor is given.
- audio bitrate & volume are not used when no audio is exported.
Note that I did not touch `BKE_ffmpeg_preset_set()`. There are currently two
preset systems for FFmpeg (`BKE_ffmpeg_preset_set()` and the Python preset
system). Before we do more work on `BKE_ffmpeg_preset_set()`, I think it's a
good idea to determine whether we want to keep it at all.
After this patch has been accepted, I'd be happy to go through the code and
remove any then-obsolete bits, such as the handling of "XVID" as a container
format.
Reviewers: sergey, mont29, brecht
Subscribers: mpan3, Blendify, brecht, fsiddi
Tags: #bf_blender
Differential Revision: https://developer.blender.org/D2242
2016-09-21 15:01:51 +02:00
|
|
|
* Assumes we output 8-bit video. Needs to be remapped if 10-bit
|
|
|
|
* is output.
|
|
|
|
* We use a slightly wider than "subjectively sane range" according
|
|
|
|
* to https://trac.ffmpeg.org/wiki/Encode/H.264#a1.ChooseaCRFvalue
|
|
|
|
*/
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum eFFMpegCrf {
|
FFmpeg interface improvements
This patch changes a couple of things in the video output encoding.
{F362527}
- Clearer separation between container and codec. No more "format", as this is
too ambiguous. As a result, codecs were removed from the container list.
- Added FFmpeg speed presets, so the user can choosen from the range "Very
slow" to "Ultra fast". By default no preset is used.
- Added Constant Rate Factor (CRF) mode, which allows changing the bit-rate
depending on the desired quality and the input. This generally produces the
best quality videos, at the expense of not knowing the exact bit-rate and
file size.
- Added optional maximum of non-B-frames between B-frames (`max_b_frames`).
- Presets were adjusted for these changes, and new presets added. One of the
new presets is [recommended](https://trac.ffmpeg.org/wiki/Encode/VFX#H.264)
for reviewing videos, as it allows players to scrub through it easily. Might
be nice in weeklies. This preset also requires control over the
`max_b_frames` setting.
GUI-only changes:
- Renamed "MPEG" in the output file format menu with "FFmpeg", as this is more
accurate. After all, FFmpeg is used when this option is chosen, which can
also output non-MPEG files.
- Certain parts of the GUI are disabled when not in use:
- bit rate options are not used when a constant rate factor is given.
- audio bitrate & volume are not used when no audio is exported.
Note that I did not touch `BKE_ffmpeg_preset_set()`. There are currently two
preset systems for FFmpeg (`BKE_ffmpeg_preset_set()` and the Python preset
system). Before we do more work on `BKE_ffmpeg_preset_set()`, I think it's a
good idea to determine whether we want to keep it at all.
After this patch has been accepted, I'd be happy to go through the code and
remove any then-obsolete bits, such as the handling of "XVID" as a container
format.
Reviewers: sergey, mont29, brecht
Subscribers: mpan3, Blendify, brecht, fsiddi
Tags: #bf_blender
Differential Revision: https://developer.blender.org/D2242
2016-09-21 15:01:51 +02:00
|
|
|
FFM_CRF_NONE = -1,
|
|
|
|
FFM_CRF_LOSSLESS = 0,
|
|
|
|
FFM_CRF_PERC_LOSSLESS = 17,
|
|
|
|
FFM_CRF_HIGH = 20,
|
|
|
|
FFM_CRF_MEDIUM = 23,
|
|
|
|
FFM_CRF_LOW = 26,
|
|
|
|
FFM_CRF_VERYLOW = 29,
|
|
|
|
FFM_CRF_LOWEST = 32,
|
2017-10-17 04:43:10 +02:00
|
|
|
} eFFMpegCrf;
|
FFmpeg interface improvements
This patch changes a couple of things in the video output encoding.
{F362527}
- Clearer separation between container and codec. No more "format", as this is
too ambiguous. As a result, codecs were removed from the container list.
- Added FFmpeg speed presets, so the user can choosen from the range "Very
slow" to "Ultra fast". By default no preset is used.
- Added Constant Rate Factor (CRF) mode, which allows changing the bit-rate
depending on the desired quality and the input. This generally produces the
best quality videos, at the expense of not knowing the exact bit-rate and
file size.
- Added optional maximum of non-B-frames between B-frames (`max_b_frames`).
- Presets were adjusted for these changes, and new presets added. One of the
new presets is [recommended](https://trac.ffmpeg.org/wiki/Encode/VFX#H.264)
for reviewing videos, as it allows players to scrub through it easily. Might
be nice in weeklies. This preset also requires control over the
`max_b_frames` setting.
GUI-only changes:
- Renamed "MPEG" in the output file format menu with "FFmpeg", as this is more
accurate. After all, FFmpeg is used when this option is chosen, which can
also output non-MPEG files.
- Certain parts of the GUI are disabled when not in use:
- bit rate options are not used when a constant rate factor is given.
- audio bitrate & volume are not used when no audio is exported.
Note that I did not touch `BKE_ffmpeg_preset_set()`. There are currently two
preset systems for FFmpeg (`BKE_ffmpeg_preset_set()` and the Python preset
system). Before we do more work on `BKE_ffmpeg_preset_set()`, I think it's a
good idea to determine whether we want to keep it at all.
After this patch has been accepted, I'd be happy to go through the code and
remove any then-obsolete bits, such as the handling of "XVID" as a container
format.
Reviewers: sergey, mont29, brecht
Subscribers: mpan3, Blendify, brecht, fsiddi
Tags: #bf_blender
Differential Revision: https://developer.blender.org/D2242
2016-09-21 15:01:51 +02:00
|
|
|
|
2018-09-28 12:03:15 +02:00
|
|
|
typedef enum eFFMpegAudioChannels {
|
|
|
|
FFM_CHANNELS_MONO = 1,
|
|
|
|
FFM_CHANNELS_STEREO = 2,
|
|
|
|
FFM_CHANNELS_SURROUND4 = 4,
|
|
|
|
FFM_CHANNELS_SURROUND51 = 6,
|
|
|
|
FFM_CHANNELS_SURROUND71 = 8,
|
|
|
|
} eFFMpegAudioChannels;
|
|
|
|
|
2006-02-05 20:18:55 +01:00
|
|
|
typedef struct FFMpegCodecData {
|
2007-01-09 12:10:12 +01:00
|
|
|
int type;
|
|
|
|
int codec;
|
|
|
|
int audio_codec;
|
|
|
|
int video_bitrate;
|
|
|
|
int audio_bitrate;
|
2009-09-20 16:00:00 +02:00
|
|
|
int audio_mixrate;
|
2011-06-21 22:39:41 +02:00
|
|
|
int audio_channels;
|
2009-09-20 19:55:03 +02:00
|
|
|
float audio_volume;
|
2007-01-09 12:10:12 +01:00
|
|
|
int gop_size;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Only used if FFMPEG_USE_MAX_B_FRAMES flag is set. */
|
|
|
|
int max_b_frames;
|
2007-01-09 12:10:12 +01:00
|
|
|
int flags;
|
FFmpeg interface improvements
This patch changes a couple of things in the video output encoding.
{F362527}
- Clearer separation between container and codec. No more "format", as this is
too ambiguous. As a result, codecs were removed from the container list.
- Added FFmpeg speed presets, so the user can choosen from the range "Very
slow" to "Ultra fast". By default no preset is used.
- Added Constant Rate Factor (CRF) mode, which allows changing the bit-rate
depending on the desired quality and the input. This generally produces the
best quality videos, at the expense of not knowing the exact bit-rate and
file size.
- Added optional maximum of non-B-frames between B-frames (`max_b_frames`).
- Presets were adjusted for these changes, and new presets added. One of the
new presets is [recommended](https://trac.ffmpeg.org/wiki/Encode/VFX#H.264)
for reviewing videos, as it allows players to scrub through it easily. Might
be nice in weeklies. This preset also requires control over the
`max_b_frames` setting.
GUI-only changes:
- Renamed "MPEG" in the output file format menu with "FFmpeg", as this is more
accurate. After all, FFmpeg is used when this option is chosen, which can
also output non-MPEG files.
- Certain parts of the GUI are disabled when not in use:
- bit rate options are not used when a constant rate factor is given.
- audio bitrate & volume are not used when no audio is exported.
Note that I did not touch `BKE_ffmpeg_preset_set()`. There are currently two
preset systems for FFmpeg (`BKE_ffmpeg_preset_set()` and the Python preset
system). Before we do more work on `BKE_ffmpeg_preset_set()`, I think it's a
good idea to determine whether we want to keep it at all.
After this patch has been accepted, I'd be happy to go through the code and
remove any then-obsolete bits, such as the handling of "XVID" as a container
format.
Reviewers: sergey, mont29, brecht
Subscribers: mpan3, Blendify, brecht, fsiddi
Tags: #bf_blender
Differential Revision: https://developer.blender.org/D2242
2016-09-21 15:01:51 +02:00
|
|
|
int constant_rate_factor;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** See eFFMpegPreset. */
|
|
|
|
int ffmpeg_preset;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2006-02-05 20:18:55 +01:00
|
|
|
int rc_min_rate;
|
|
|
|
int rc_max_rate;
|
|
|
|
int rc_buffer_size;
|
|
|
|
int mux_packet_size;
|
|
|
|
int mux_rate;
|
2022-02-18 18:20:06 +01:00
|
|
|
void *_pad1;
|
2006-02-05 20:18:55 +01:00
|
|
|
} FFMpegCodecData;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Audio
|
|
|
|
* \{ */
|
2006-02-05 20:18:55 +01:00
|
|
|
|
Commit message and the brunt of the code courtesy of intrr, apologies for the
size of this;
Finally, the Sequencer audio support and global audio/animation sync stuff!
(See http://intrr.org/blender/audiosequencer.html)
Stuff that has been done:
./source/blender/blenloader/intern/writefile.c
./source/blender/blenloader/intern/readfile.c
Added code to make it handle sounds used by audio strips, and to convert
Scene data from older (<2.28) versions to init Scene global audio settings
(Scene->audio) to defaults.
./source/blender/include/BSE_seqaudio.h
./source/blender/src/seqaudio.c
The main audio routines that start/stop/scrub the audio stream at
a certain frame position, provide the frame reference for the current
stream position, mix the audio, convert the audio, mixdown the audio
into a file.
./source/blender/makesdna/DNA_sound_types.h
Introduced new variables in the bSound struct to accomodate the sample
data after converted to the scene's global mixing format (stream, streamlen).
Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound
belongs to a sequence strip.
./source/blender/makesdna/DNA_scene_types.h
Added AudioData struct, which holds scene-global audio settings.
./source/blender/makesdna/DNA_sequence_types.h
Added support for audio strips. Some variables to hold Panning/Attenuation
information, position information, reference to the sample, and some flags.
./source/blender/makesdna/DNA_userdef_types.h
./source/blender/src/usiblender.c
Added a "Mixing buffer size" userpref. Made the versions stuff initialize
it to a default for versions <2.28.
./source/blender/makesdna/DNA_space_types.h
./source/blender/src/filesel.c
Added a Cyan dot to .WAV files. Any other suggestions on a better color? :)
./source/blender/src/editsound.c
Changes (fixes) to the WAV file loader, re-enabled some gameengine code that
is needed for dealing with bSounds and bSamples.
./source/blender/src/editipo.c
./source/blender/src/drawseq.c
./source/blender/src/editnla.c
./source/blender/src/space.c
./source/blender/src/drawview.c
./source/blender/src/renderwin.c
./source/blender/src/headerbuttons.c
- Created two different wrappers for update_for_newframe(), one which scrubs
the audio, one which doesn't.
- Replaced some of the occurences of update_for_newframe() with
update_for_newframe_muted(), which doesn't scrub the audio.
- In drawview.c: Changed the synchronization scheme to get the current audio
position from the audio engine, and use that as a reference for setting
CFRA. Implements a/v sync and framedrop.
- In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as
volume envelopes.
- In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing
(update_for_newframe()) for moving the sequence editor framebar.
./source/blender/src/editseq.c
Added support for audio strips and a default directory for WAV files which
gets saved from the last Shift-A operation.
./source/blender/src/buttons.c
Added Scene-global audio sequencer settings in Sound buttons.
./source/blender/src/sequence.c
Various stuff that deals with handling audio strips differently than
usual strips.
2003-07-13 22:16:56 +02:00
|
|
|
typedef struct AudioData {
|
2022-12-15 00:31:18 +01:00
|
|
|
int mixrate; /* 2.5: now in FFMpegCodecData: audio_mixrate. */
|
|
|
|
float main; /* 2.5: now in FFMpegCodecData: audio_volume. */
|
2009-09-20 19:55:03 +02:00
|
|
|
float speed_of_sound;
|
|
|
|
float doppler_factor;
|
|
|
|
int distance_model;
|
Commit message and the brunt of the code courtesy of intrr, apologies for the
size of this;
Finally, the Sequencer audio support and global audio/animation sync stuff!
(See http://intrr.org/blender/audiosequencer.html)
Stuff that has been done:
./source/blender/blenloader/intern/writefile.c
./source/blender/blenloader/intern/readfile.c
Added code to make it handle sounds used by audio strips, and to convert
Scene data from older (<2.28) versions to init Scene global audio settings
(Scene->audio) to defaults.
./source/blender/include/BSE_seqaudio.h
./source/blender/src/seqaudio.c
The main audio routines that start/stop/scrub the audio stream at
a certain frame position, provide the frame reference for the current
stream position, mix the audio, convert the audio, mixdown the audio
into a file.
./source/blender/makesdna/DNA_sound_types.h
Introduced new variables in the bSound struct to accomodate the sample
data after converted to the scene's global mixing format (stream, streamlen).
Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound
belongs to a sequence strip.
./source/blender/makesdna/DNA_scene_types.h
Added AudioData struct, which holds scene-global audio settings.
./source/blender/makesdna/DNA_sequence_types.h
Added support for audio strips. Some variables to hold Panning/Attenuation
information, position information, reference to the sample, and some flags.
./source/blender/makesdna/DNA_userdef_types.h
./source/blender/src/usiblender.c
Added a "Mixing buffer size" userpref. Made the versions stuff initialize
it to a default for versions <2.28.
./source/blender/makesdna/DNA_space_types.h
./source/blender/src/filesel.c
Added a Cyan dot to .WAV files. Any other suggestions on a better color? :)
./source/blender/src/editsound.c
Changes (fixes) to the WAV file loader, re-enabled some gameengine code that
is needed for dealing with bSounds and bSamples.
./source/blender/src/editipo.c
./source/blender/src/drawseq.c
./source/blender/src/editnla.c
./source/blender/src/space.c
./source/blender/src/drawview.c
./source/blender/src/renderwin.c
./source/blender/src/headerbuttons.c
- Created two different wrappers for update_for_newframe(), one which scrubs
the audio, one which doesn't.
- Replaced some of the occurences of update_for_newframe() with
update_for_newframe_muted(), which doesn't scrub the audio.
- In drawview.c: Changed the synchronization scheme to get the current audio
position from the audio engine, and use that as a reference for setting
CFRA. Implements a/v sync and framedrop.
- In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as
volume envelopes.
- In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing
(update_for_newframe()) for moving the sequence editor framebar.
./source/blender/src/editseq.c
Added support for audio strips and a default directory for WAV files which
gets saved from the last Shift-A operation.
./source/blender/src/buttons.c
Added Scene-global audio sequencer settings in Sound buttons.
./source/blender/src/sequence.c
Various stuff that deals with handling audio strips differently than
usual strips.
2003-07-13 22:16:56 +02:00
|
|
|
short flag;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad[2];
|
3D Audio GSoC:
Implemented basic audio animation.
* AnimatableProperty: Propper cache writing and spline interpolation for reading (the solution for stair steps in audio animation)
* Animatable properties so far are: volume, pitch, panning
* Users note: Changing the pitch of a sound results in wrong seeking, due to the resulting playback length difference.
* Users note: Panning only works for mono sources, values are in the range [-2..2], this basically controls the angle of the sound, 0 is front, -1 left, 1 right and 2 and -2 are back. Typical stereo panning only supports [-1..1].
* Disabled animation of audio related ffmpeg output parameters.
* Scene Audio Panel: 3D Listener settings also for Renderer, new Volume property (animatable!), Update/Bake buttons for animation problems, moved sampling rate and channel count here
2011-07-28 15:58:59 +02:00
|
|
|
float volume;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad2[4];
|
Commit message and the brunt of the code courtesy of intrr, apologies for the
size of this;
Finally, the Sequencer audio support and global audio/animation sync stuff!
(See http://intrr.org/blender/audiosequencer.html)
Stuff that has been done:
./source/blender/blenloader/intern/writefile.c
./source/blender/blenloader/intern/readfile.c
Added code to make it handle sounds used by audio strips, and to convert
Scene data from older (<2.28) versions to init Scene global audio settings
(Scene->audio) to defaults.
./source/blender/include/BSE_seqaudio.h
./source/blender/src/seqaudio.c
The main audio routines that start/stop/scrub the audio stream at
a certain frame position, provide the frame reference for the current
stream position, mix the audio, convert the audio, mixdown the audio
into a file.
./source/blender/makesdna/DNA_sound_types.h
Introduced new variables in the bSound struct to accomodate the sample
data after converted to the scene's global mixing format (stream, streamlen).
Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound
belongs to a sequence strip.
./source/blender/makesdna/DNA_scene_types.h
Added AudioData struct, which holds scene-global audio settings.
./source/blender/makesdna/DNA_sequence_types.h
Added support for audio strips. Some variables to hold Panning/Attenuation
information, position information, reference to the sample, and some flags.
./source/blender/makesdna/DNA_userdef_types.h
./source/blender/src/usiblender.c
Added a "Mixing buffer size" userpref. Made the versions stuff initialize
it to a default for versions <2.28.
./source/blender/makesdna/DNA_space_types.h
./source/blender/src/filesel.c
Added a Cyan dot to .WAV files. Any other suggestions on a better color? :)
./source/blender/src/editsound.c
Changes (fixes) to the WAV file loader, re-enabled some gameengine code that
is needed for dealing with bSounds and bSamples.
./source/blender/src/editipo.c
./source/blender/src/drawseq.c
./source/blender/src/editnla.c
./source/blender/src/space.c
./source/blender/src/drawview.c
./source/blender/src/renderwin.c
./source/blender/src/headerbuttons.c
- Created two different wrappers for update_for_newframe(), one which scrubs
the audio, one which doesn't.
- Replaced some of the occurences of update_for_newframe() with
update_for_newframe_muted(), which doesn't scrub the audio.
- In drawview.c: Changed the synchronization scheme to get the current audio
position from the audio engine, and use that as a reference for setting
CFRA. Implements a/v sync and framedrop.
- In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as
volume envelopes.
- In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing
(update_for_newframe()) for moving the sequence editor framebar.
./source/blender/src/editseq.c
Added support for audio strips and a default directory for WAV files which
gets saved from the last Shift-A operation.
./source/blender/src/buttons.c
Added Scene-global audio sequencer settings in Sound buttons.
./source/blender/src/sequence.c
Various stuff that deals with handling audio strips differently than
usual strips.
2003-07-13 22:16:56 +02:00
|
|
|
} AudioData;
|
2003-05-21 03:21:07 +02:00
|
|
|
|
2023-04-19 00:40:23 +02:00
|
|
|
/** \} */
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Render Layers
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Render Layer. */
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 23:18:46 +01:00
|
|
|
typedef struct SceneRenderLayer {
|
|
|
|
struct SceneRenderLayer *next, *prev;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** MAX_NAME. */
|
|
|
|
char name[64] DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Converted to ViewLayer setting. */
|
|
|
|
struct Material *mat_override DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Converted to LayerCollection cycles camera visibility override. */
|
|
|
|
unsigned int lay DNA_DEPRECATED;
|
|
|
|
/** Converted to LayerCollection cycles holdout override. */
|
|
|
|
unsigned int lay_zmask DNA_DEPRECATED;
|
2017-11-14 19:18:14 +01:00
|
|
|
unsigned int lay_exclude DNA_DEPRECATED;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Converted to ViewLayer layflag and flag. */
|
|
|
|
int layflag DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Pass_xor has to be after passflag. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Pass_xor has to be after passflag. */
|
|
|
|
int passflag DNA_DEPRECATED;
|
|
|
|
/** Converted to ViewLayer passflag and flag. */
|
|
|
|
int pass_xor DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Converted to ViewLayer setting. */
|
|
|
|
int samples DNA_DEPRECATED;
|
|
|
|
/** Converted to ViewLayer pass_alpha_threshold. */
|
|
|
|
float pass_alpha_threshold DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Converted to ViewLayer id_properties. */
|
|
|
|
IDProperty *prop DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Converted to ViewLayer freestyleConfig. */
|
|
|
|
struct FreestyleConfig freestyleConfig DNA_DEPRECATED;
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 23:18:46 +01:00
|
|
|
} SceneRenderLayer;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #SceneRenderLayer::layflag */
|
|
|
|
enum {
|
|
|
|
SCE_LAY_SOLID = 1 << 0,
|
|
|
|
SCE_LAY_UNUSED_1 = 1 << 1,
|
|
|
|
SCE_LAY_UNUSED_2 = 1 << 2,
|
|
|
|
SCE_LAY_UNUSED_3 = 1 << 3,
|
|
|
|
SCE_LAY_SKY = 1 << 4,
|
|
|
|
SCE_LAY_STRAND = 1 << 5,
|
|
|
|
SCE_LAY_FRS = 1 << 6,
|
|
|
|
SCE_LAY_AO = 1 << 7,
|
|
|
|
SCE_LAY_VOLUMES = 1 << 8,
|
|
|
|
SCE_LAY_MOTION_BLUR = 1 << 9,
|
|
|
|
|
|
|
|
/* Flags between (1 << 9) and (1 << 15) are set to 1 already, for future options. */
|
|
|
|
|
|
|
|
SCE_LAY_FLAG_DEFAULT = ((1 << 15) - 1),
|
|
|
|
|
|
|
|
SCE_LAY_UNUSED_4 = 1 << 15,
|
|
|
|
SCE_LAY_UNUSED_5 = 1 << 16,
|
|
|
|
SCE_LAY_DISABLE = 1 << 17,
|
|
|
|
SCE_LAY_UNUSED_6 = 1 << 18,
|
|
|
|
SCE_LAY_UNUSED_7 = 1 << 19,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #SceneRenderLayer::passflag */
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum eScenePassType {
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
SCE_PASS_COMBINED = (1 << 0),
|
|
|
|
SCE_PASS_Z = (1 << 1),
|
2019-03-17 00:28:08 +01:00
|
|
|
SCE_PASS_UNUSED_1 = (1 << 2), /* RGBA */
|
|
|
|
SCE_PASS_UNUSED_2 = (1 << 3), /* DIFFUSE */
|
|
|
|
SCE_PASS_UNUSED_3 = (1 << 4), /* SPEC */
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
SCE_PASS_SHADOW = (1 << 5),
|
|
|
|
SCE_PASS_AO = (1 << 6),
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
SCE_PASS_POSITION = (1 << 7),
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
SCE_PASS_NORMAL = (1 << 8),
|
|
|
|
SCE_PASS_VECTOR = (1 << 9),
|
2019-03-17 00:28:08 +01:00
|
|
|
SCE_PASS_UNUSED_5 = (1 << 10), /* REFRACT */
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
SCE_PASS_INDEXOB = (1 << 11),
|
|
|
|
SCE_PASS_UV = (1 << 12),
|
2019-03-17 00:28:08 +01:00
|
|
|
SCE_PASS_UNUSED_6 = (1 << 13), /* INDIRECT */
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
SCE_PASS_MIST = (1 << 14),
|
2021-07-29 16:34:54 +02:00
|
|
|
SCE_PASS_UNUSED_7 = (1 << 15), /* RAYHITS */
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
SCE_PASS_EMIT = (1 << 16),
|
|
|
|
SCE_PASS_ENVIRONMENT = (1 << 17),
|
|
|
|
SCE_PASS_INDEXMA = (1 << 18),
|
|
|
|
SCE_PASS_DIFFUSE_DIRECT = (1 << 19),
|
|
|
|
SCE_PASS_DIFFUSE_INDIRECT = (1 << 20),
|
|
|
|
SCE_PASS_DIFFUSE_COLOR = (1 << 21),
|
|
|
|
SCE_PASS_GLOSSY_DIRECT = (1 << 22),
|
|
|
|
SCE_PASS_GLOSSY_INDIRECT = (1 << 23),
|
|
|
|
SCE_PASS_GLOSSY_COLOR = (1 << 24),
|
|
|
|
SCE_PASS_TRANSM_DIRECT = (1 << 25),
|
|
|
|
SCE_PASS_TRANSM_INDIRECT = (1 << 26),
|
|
|
|
SCE_PASS_TRANSM_COLOR = (1 << 27),
|
|
|
|
SCE_PASS_SUBSURFACE_DIRECT = (1 << 28),
|
|
|
|
SCE_PASS_SUBSURFACE_INDIRECT = (1 << 29),
|
|
|
|
SCE_PASS_SUBSURFACE_COLOR = (1 << 30),
|
2018-12-01 09:36:57 +01:00
|
|
|
SCE_PASS_ROUGHNESS = (1u << 31u),
|
2017-10-17 04:43:10 +02:00
|
|
|
} eScenePassType;
|
2009-07-06 15:27:40 +02:00
|
|
|
|
2018-12-28 10:26:45 +01:00
|
|
|
#define RE_PASSNAME_DEPRECATED "Deprecated"
|
|
|
|
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
#define RE_PASSNAME_COMBINED "Combined"
|
|
|
|
#define RE_PASSNAME_Z "Depth"
|
|
|
|
#define RE_PASSNAME_VECTOR "Vector"
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
#define RE_PASSNAME_POSITION "Position"
|
Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.
To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.
To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.
From a user perspective, nothing should change with this commit.
Differential Revision: https://developer.blender.org/D2443
Differential Revision: https://developer.blender.org/D2444
2017-05-03 00:21:18 +02:00
|
|
|
#define RE_PASSNAME_NORMAL "Normal"
|
|
|
|
#define RE_PASSNAME_UV "UV"
|
|
|
|
#define RE_PASSNAME_EMIT "Emit"
|
|
|
|
#define RE_PASSNAME_SHADOW "Shadow"
|
|
|
|
|
|
|
|
#define RE_PASSNAME_AO "AO"
|
|
|
|
#define RE_PASSNAME_ENVIRONMENT "Env"
|
|
|
|
#define RE_PASSNAME_INDEXOB "IndexOB"
|
|
|
|
#define RE_PASSNAME_INDEXMA "IndexMA"
|
|
|
|
#define RE_PASSNAME_MIST "Mist"
|
|
|
|
|
|
|
|
#define RE_PASSNAME_DIFFUSE_DIRECT "DiffDir"
|
|
|
|
#define RE_PASSNAME_DIFFUSE_INDIRECT "DiffInd"
|
|
|
|
#define RE_PASSNAME_DIFFUSE_COLOR "DiffCol"
|
|
|
|
#define RE_PASSNAME_GLOSSY_DIRECT "GlossDir"
|
|
|
|
#define RE_PASSNAME_GLOSSY_INDIRECT "GlossInd"
|
|
|
|
#define RE_PASSNAME_GLOSSY_COLOR "GlossCol"
|
|
|
|
#define RE_PASSNAME_TRANSM_DIRECT "TransDir"
|
|
|
|
#define RE_PASSNAME_TRANSM_INDIRECT "TransInd"
|
|
|
|
#define RE_PASSNAME_TRANSM_COLOR "TransCol"
|
|
|
|
|
|
|
|
#define RE_PASSNAME_SUBSURFACE_DIRECT "SubsurfaceDir"
|
|
|
|
#define RE_PASSNAME_SUBSURFACE_INDIRECT "SubsurfaceInd"
|
|
|
|
#define RE_PASSNAME_SUBSURFACE_COLOR "SubsurfaceCol"
|
|
|
|
|
2020-02-13 01:29:30 +01:00
|
|
|
#define RE_PASSNAME_FREESTYLE "Freestyle"
|
2020-02-20 14:53:53 +01:00
|
|
|
#define RE_PASSNAME_BLOOM "BloomCol"
|
2020-12-14 09:05:16 +01:00
|
|
|
#define RE_PASSNAME_VOLUME_LIGHT "VolumeDir"
|
2023-05-17 11:57:36 +02:00
|
|
|
#define RE_PASSNAME_TRANSPARENT "Transp"
|
2020-02-13 01:29:30 +01:00
|
|
|
|
2022-09-13 11:07:30 +02:00
|
|
|
#define RE_PASSNAME_CRYPTOMATTE_OBJECT "CryptoObject"
|
|
|
|
#define RE_PASSNAME_CRYPTOMATTE_ASSET "CryptoAsset"
|
|
|
|
#define RE_PASSNAME_CRYPTOMATTE_MATERIAL "CryptoMaterial"
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Multi-View
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
/** View (Multi-view). */
|
2015-04-06 15:40:12 +02:00
|
|
|
typedef struct SceneRenderView {
|
|
|
|
struct SceneRenderView *next, *prev;
|
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** MAX_NAME. */
|
|
|
|
char name[64];
|
|
|
|
/** MAX_NAME. */
|
|
|
|
char suffix[64];
|
2015-04-06 15:40:12 +02:00
|
|
|
|
|
|
|
int viewflag;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad2[4];
|
2015-04-06 15:40:12 +02:00
|
|
|
|
|
|
|
} SceneRenderView;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #SceneRenderView::viewflag */
|
|
|
|
enum {
|
|
|
|
SCE_VIEW_DISABLE = 1 << 0,
|
|
|
|
};
|
2015-04-06 15:40:12 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RenderData::views_format */
|
2015-04-06 15:40:12 +02:00
|
|
|
enum {
|
|
|
|
SCE_VIEWS_FORMAT_STEREO_3D = 0,
|
|
|
|
SCE_VIEWS_FORMAT_MULTIVIEW = 1,
|
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ImageFormatData::views_format (also used for #Sequence::views_format). */
|
2015-04-06 15:40:12 +02:00
|
|
|
enum {
|
|
|
|
R_IMF_VIEWS_INDIVIDUAL = 0,
|
|
|
|
R_IMF_VIEWS_STEREO_3D = 1,
|
|
|
|
R_IMF_VIEWS_MULTIVIEW = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct Stereo3dFormat {
|
|
|
|
short flag;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Encoding mode. */
|
|
|
|
char display_mode;
|
|
|
|
/** Anaglyph scheme for the user display. */
|
|
|
|
char anaglyph_type;
|
|
|
|
/** Interlace type for the user display. */
|
|
|
|
char interlace_type;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad[3];
|
2015-04-06 15:40:12 +02:00
|
|
|
} Stereo3dFormat;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #Stereo3dFormat::display_mode */
|
2015-04-06 15:40:12 +02:00
|
|
|
typedef enum eStereoDisplayMode {
|
|
|
|
S3D_DISPLAY_ANAGLYPH = 0,
|
|
|
|
S3D_DISPLAY_INTERLACE = 1,
|
|
|
|
S3D_DISPLAY_PAGEFLIP = 2,
|
|
|
|
S3D_DISPLAY_SIDEBYSIDE = 3,
|
|
|
|
S3D_DISPLAY_TOPBOTTOM = 4,
|
|
|
|
} eStereoDisplayMode;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #Stereo3dFormat::flag */
|
2015-04-06 15:40:12 +02:00
|
|
|
typedef enum eStereo3dFlag {
|
|
|
|
S3D_INTERLACE_SWAP = (1 << 0),
|
|
|
|
S3D_SIDEBYSIDE_CROSSEYED = (1 << 1),
|
|
|
|
S3D_SQUEEZED_FRAME = (1 << 2),
|
|
|
|
} eStereo3dFlag;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #Stereo3dFormat::anaglyph_type */
|
2015-04-06 15:40:12 +02:00
|
|
|
typedef enum eStereo3dAnaglyphType {
|
|
|
|
S3D_ANAGLYPH_REDCYAN = 0,
|
|
|
|
S3D_ANAGLYPH_GREENMAGENTA = 1,
|
|
|
|
S3D_ANAGLYPH_YELLOWBLUE = 2,
|
|
|
|
} eStereo3dAnaglyphType;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #Stereo3dFormat::interlace_type */
|
2015-04-06 15:40:12 +02:00
|
|
|
typedef enum eStereo3dInterlaceType {
|
|
|
|
S3D_INTERLACE_ROW = 0,
|
|
|
|
S3D_INTERLACE_COLUMN = 1,
|
|
|
|
S3D_INTERLACE_CHECKERBOARD = 2,
|
|
|
|
} eStereo3dInterlaceType;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Image Format Data
|
|
|
|
* \{ */
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 23:18:46 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
|
|
|
* Generic image format settings,
|
|
|
|
* this is used for #NodeImageFile and IMAGE_OT_save_as operator too.
|
2011-11-22 11:04:28 +01:00
|
|
|
*
|
2021-07-03 15:08:40 +02:00
|
|
|
* NOTE: its a bit strange that even though this is an image format struct
|
2018-09-02 10:28:27 +02:00
|
|
|
* the imtype can still be used to select video formats.
|
|
|
|
* RNA ensures these enum's are only selectable for render output.
|
2011-11-22 11:04:28 +01:00
|
|
|
*/
|
2011-11-21 21:19:58 +01:00
|
|
|
typedef struct ImageFormatData {
|
2019-01-07 12:19:13 +01:00
|
|
|
/**
|
|
|
|
* R_IMF_IMTYPE_PNG, R_...
|
2019-11-24 15:14:39 +01:00
|
|
|
* \note Video types should only ever be set from this structure when used from #RenderData.
|
2019-01-07 12:19:13 +01:00
|
|
|
*/
|
|
|
|
char imtype;
|
|
|
|
/**
|
|
|
|
* bits per channel, R_IMF_CHAN_DEPTH_8 -> 32,
|
|
|
|
* not a flag, only set 1 at a time. */
|
|
|
|
char depth;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA. */
|
|
|
|
char planes;
|
2022-09-19 06:47:27 +02:00
|
|
|
/** Generic options for all image types, alpha Z-buffer. */
|
2019-01-07 12:19:13 +01:00
|
|
|
char flag;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-09-16 10:13:19 +02:00
|
|
|
/** (0 - 100), eg: JPEG quality. */
|
2019-01-07 12:19:13 +01:00
|
|
|
char quality;
|
2022-09-16 10:13:19 +02:00
|
|
|
/** (0 - 100), eg: PNG compression. */
|
2019-01-07 12:19:13 +01:00
|
|
|
char compress;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-11-21 21:19:58 +01:00
|
|
|
/* --- format specific --- */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** OpenEXR. */
|
2011-11-21 21:19:58 +01:00
|
|
|
char exr_codec;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-01-16 03:57:10 +01:00
|
|
|
/** CINEON. */
|
2011-11-21 21:19:58 +01:00
|
|
|
char cineon_flag;
|
|
|
|
short cineon_white, cineon_black;
|
|
|
|
float cineon_gamma;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Jpeg2000. */
|
2011-11-21 21:19:58 +01:00
|
|
|
char jp2_flag;
|
2012-12-23 14:57:09 +01:00
|
|
|
char jp2_codec;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** TIFF. */
|
2016-01-14 11:02:13 +01:00
|
|
|
char tiff_codec;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad[4];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Multi-view. */
|
2015-04-06 15:40:12 +02:00
|
|
|
char views_format;
|
|
|
|
Stereo3dFormat stereo3d_format;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Color management members. */
|
|
|
|
|
2022-03-09 15:38:17 +01:00
|
|
|
char color_management;
|
|
|
|
char _pad1[7];
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
ColorManagedViewSettings view_settings;
|
|
|
|
ColorManagedDisplaySettings display_settings;
|
2022-03-11 17:50:57 +01:00
|
|
|
ColorManagedColorspaceSettings linear_colorspace_settings;
|
2011-11-21 21:19:58 +01:00
|
|
|
} ImageFormatData;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ImageFormatData::imtype */
|
|
|
|
enum {
|
|
|
|
R_IMF_IMTYPE_TARGA = 0,
|
|
|
|
R_IMF_IMTYPE_IRIS = 1,
|
|
|
|
// R_HAMX = 2, /* DEPRECATED */
|
|
|
|
// R_FTYPE = 3, /* DEPRECATED */
|
|
|
|
R_IMF_IMTYPE_JPEG90 = 4,
|
|
|
|
// R_MOVIE = 5, /* DEPRECATED */
|
|
|
|
R_IMF_IMTYPE_IRIZ = 7,
|
|
|
|
R_IMF_IMTYPE_RAWTGA = 14,
|
|
|
|
R_IMF_IMTYPE_AVIRAW = 15,
|
|
|
|
R_IMF_IMTYPE_AVIJPEG = 16,
|
|
|
|
R_IMF_IMTYPE_PNG = 17,
|
|
|
|
// R_IMF_IMTYPE_AVICODEC = 18, /* DEPRECATED */
|
|
|
|
// R_IMF_IMTYPE_QUICKTIME = 19, /* DEPRECATED */
|
|
|
|
R_IMF_IMTYPE_BMP = 20,
|
|
|
|
R_IMF_IMTYPE_RADHDR = 21,
|
|
|
|
R_IMF_IMTYPE_TIFF = 22,
|
|
|
|
R_IMF_IMTYPE_OPENEXR = 23,
|
|
|
|
R_IMF_IMTYPE_FFMPEG = 24,
|
|
|
|
// R_IMF_IMTYPE_FRAMESERVER = 25, /* DEPRECATED */
|
|
|
|
R_IMF_IMTYPE_CINEON = 26,
|
|
|
|
R_IMF_IMTYPE_DPX = 27,
|
|
|
|
R_IMF_IMTYPE_MULTILAYER = 28,
|
|
|
|
R_IMF_IMTYPE_DDS = 29,
|
|
|
|
R_IMF_IMTYPE_JP2 = 30,
|
|
|
|
R_IMF_IMTYPE_H264 = 31,
|
|
|
|
R_IMF_IMTYPE_XVID = 32,
|
|
|
|
R_IMF_IMTYPE_THEORA = 33,
|
|
|
|
R_IMF_IMTYPE_PSD = 34,
|
|
|
|
R_IMF_IMTYPE_WEBP = 35,
|
|
|
|
R_IMF_IMTYPE_AV1 = 36,
|
|
|
|
|
|
|
|
R_IMF_IMTYPE_INVALID = 255,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ImageFormatData::flag */
|
|
|
|
enum {
|
2023-07-04 17:03:02 +02:00
|
|
|
// R_IMF_FLAG_ZBUF = 1 << 0, /* DEPRECATED, and cleared. */
|
2023-06-26 04:09:49 +02:00
|
|
|
R_IMF_FLAG_PREVIEW_JPG = 1 << 1,
|
|
|
|
};
|
2011-11-21 21:19:58 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* */
|
|
|
|
|
|
|
|
/**
|
2023-06-26 04:09:49 +02:00
|
|
|
* #ImageFormatData::depth
|
2022-12-15 00:31:18 +01:00
|
|
|
*
|
|
|
|
* Return values from #BKE_imtype_valid_depths, note this is depths per channel.
|
|
|
|
*/
|
2019-11-05 16:55:51 +01:00
|
|
|
typedef enum eImageFormatDepth {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** 1bits (unused). */
|
2019-11-05 16:55:51 +01:00
|
|
|
R_IMF_CHAN_DEPTH_1 = (1 << 0),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** 8bits (default). */
|
2019-11-05 16:55:51 +01:00
|
|
|
R_IMF_CHAN_DEPTH_8 = (1 << 1),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** 10bits (uncommon, Cineon/DPX support). */
|
2019-11-05 16:55:51 +01:00
|
|
|
R_IMF_CHAN_DEPTH_10 = (1 << 2),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** 12bits (uncommon, jp2/DPX support). */
|
2019-11-05 16:55:51 +01:00
|
|
|
R_IMF_CHAN_DEPTH_12 = (1 << 3),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** 16bits (TIFF, half float EXR). */
|
2019-11-05 16:55:51 +01:00
|
|
|
R_IMF_CHAN_DEPTH_16 = (1 << 4),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** 24bits (unused). */
|
2019-11-05 16:55:51 +01:00
|
|
|
R_IMF_CHAN_DEPTH_24 = (1 << 5),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** 32bits (full float EXR). */
|
2019-11-05 16:55:51 +01:00
|
|
|
R_IMF_CHAN_DEPTH_32 = (1 << 6),
|
|
|
|
} eImageFormatDepth;
|
2011-11-21 21:19:58 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ImageFormatData::planes */
|
|
|
|
enum {
|
|
|
|
R_IMF_PLANES_RGB = 24,
|
|
|
|
R_IMF_PLANES_RGBA = 32,
|
|
|
|
R_IMF_PLANES_BW = 8,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ImageFormatData::exr_codec */
|
|
|
|
enum {
|
|
|
|
R_IMF_EXR_CODEC_NONE = 0,
|
|
|
|
R_IMF_EXR_CODEC_PXR24 = 1,
|
|
|
|
R_IMF_EXR_CODEC_ZIP = 2,
|
|
|
|
R_IMF_EXR_CODEC_PIZ = 3,
|
|
|
|
R_IMF_EXR_CODEC_RLE = 4,
|
|
|
|
R_IMF_EXR_CODEC_ZIPS = 5,
|
|
|
|
R_IMF_EXR_CODEC_B44 = 6,
|
|
|
|
R_IMF_EXR_CODEC_B44A = 7,
|
|
|
|
R_IMF_EXR_CODEC_DWAA = 8,
|
|
|
|
R_IMF_EXR_CODEC_DWAB = 9,
|
|
|
|
R_IMF_EXR_CODEC_MAX = 10,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ImageFormatData::jp2_flag */
|
|
|
|
enum {
|
|
|
|
/** When disabled use RGB. */
|
|
|
|
R_IMF_JP2_FLAG_YCC = 1 << 0, /* Was `R_JPEG2K_YCC`. */
|
|
|
|
R_IMF_JP2_FLAG_CINE_PRESET = 1 << 1, /* Was `R_JPEG2K_CINE_PRESET`. */
|
|
|
|
R_IMF_JP2_FLAG_CINE_48 = 1 << 2, /* Was `R_JPEG2K_CINE_48FPS`. */
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ImageFormatData::jp2_codec */
|
|
|
|
enum {
|
|
|
|
R_IMF_JP2_CODEC_JP2 = 0,
|
|
|
|
R_IMF_JP2_CODEC_J2K = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ImageFormatData::cineon_flag */
|
|
|
|
enum {
|
|
|
|
R_IMF_CINEON_FLAG_LOG = 1 << 0, /* Was `R_CINEON_LOG`. */
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ImageFormatData::tiff_codec */
|
2016-01-14 11:02:13 +01:00
|
|
|
enum {
|
|
|
|
R_IMF_TIFF_CODEC_DEFLATE = 0,
|
|
|
|
R_IMF_TIFF_CODEC_LZW = 1,
|
|
|
|
R_IMF_TIFF_CODEC_PACKBITS = 2,
|
|
|
|
R_IMF_TIFF_CODEC_NONE = 3,
|
|
|
|
};
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Render Bake
|
|
|
|
* \{ */
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ImageFormatData::color_management */
|
|
|
|
enum {
|
|
|
|
R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE = 0,
|
|
|
|
R_IMF_COLOR_MANAGEMENT_OVERRIDE = 1,
|
|
|
|
};
|
2022-03-09 15:38:17 +01:00
|
|
|
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
typedef struct BakeData {
|
|
|
|
struct ImageFormatData im_format;
|
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** FILE_MAX. */
|
|
|
|
char filepath[1024];
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
|
|
|
|
short width, height;
|
|
|
|
short margin, flag;
|
|
|
|
|
|
|
|
float cage_extrusion;
|
2020-05-18 15:50:36 +02:00
|
|
|
float max_ray_distance;
|
2016-01-15 16:00:56 +01:00
|
|
|
int pass_filter;
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
|
|
|
|
char normal_swizzle[3];
|
|
|
|
char normal_space;
|
|
|
|
|
2020-12-23 21:03:00 +01:00
|
|
|
char target;
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
char save_mode;
|
2022-01-17 18:00:35 +01:00
|
|
|
char margin_type;
|
2022-10-03 19:26:02 +02:00
|
|
|
char view_from;
|
|
|
|
char _pad[4];
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
|
2018-12-07 13:41:57 +01:00
|
|
|
struct Object *cage_object;
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
} BakeData;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #BakeData::margin_type (char). */
|
2022-01-17 18:00:35 +01:00
|
|
|
typedef enum eBakeMarginType {
|
|
|
|
R_BAKE_ADJACENT_FACES = 0,
|
|
|
|
R_BAKE_EXTEND = 1,
|
|
|
|
} eBakeMarginType;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #BakeData::normal_swizzle (char). */
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum eBakeNormalSwizzle {
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
R_BAKE_POSX = 0,
|
|
|
|
R_BAKE_POSY = 1,
|
|
|
|
R_BAKE_POSZ = 2,
|
|
|
|
R_BAKE_NEGX = 3,
|
|
|
|
R_BAKE_NEGY = 4,
|
|
|
|
R_BAKE_NEGZ = 5,
|
2017-10-17 04:43:10 +02:00
|
|
|
} eBakeNormalSwizzle;
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #BakeData::target (char). */
|
2020-12-23 21:03:00 +01:00
|
|
|
typedef enum eBakeTarget {
|
|
|
|
R_BAKE_TARGET_IMAGE_TEXTURES = 0,
|
|
|
|
R_BAKE_TARGET_VERTEX_COLORS = 1,
|
|
|
|
} eBakeTarget;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #BakeData::save_mode (char). */
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum eBakeSaveMode {
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
R_BAKE_SAVE_INTERNAL = 0,
|
|
|
|
R_BAKE_SAVE_EXTERNAL = 1,
|
2017-10-17 04:43:10 +02:00
|
|
|
} eBakeSaveMode;
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #BakeData::view_from (char). */
|
2022-10-03 19:26:02 +02:00
|
|
|
typedef enum eBakeViewFrom {
|
|
|
|
R_BAKE_VIEW_FROM_ABOVE_SURFACE = 0,
|
|
|
|
R_BAKE_VIEW_FROM_ACTIVE_CAMERA = 1,
|
|
|
|
} eBakeViewFrom;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #BakeData::pass_filter */
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum eBakePassFilter {
|
2016-01-15 16:00:56 +01:00
|
|
|
R_BAKE_PASS_FILTER_NONE = 0,
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
R_BAKE_PASS_FILTER_UNUSED = (1 << 0),
|
2016-01-15 16:00:56 +01:00
|
|
|
R_BAKE_PASS_FILTER_EMIT = (1 << 1),
|
|
|
|
R_BAKE_PASS_FILTER_DIFFUSE = (1 << 2),
|
|
|
|
R_BAKE_PASS_FILTER_GLOSSY = (1 << 3),
|
|
|
|
R_BAKE_PASS_FILTER_TRANSM = (1 << 4),
|
|
|
|
R_BAKE_PASS_FILTER_SUBSURFACE = (1 << 5),
|
|
|
|
R_BAKE_PASS_FILTER_DIRECT = (1 << 6),
|
|
|
|
R_BAKE_PASS_FILTER_INDIRECT = (1 << 7),
|
|
|
|
R_BAKE_PASS_FILTER_COLOR = (1 << 8),
|
2017-10-17 04:43:10 +02:00
|
|
|
} eBakePassFilter;
|
2016-01-15 16:00:56 +01:00
|
|
|
|
|
|
|
#define R_BAKE_PASS_FILTER_ALL (~0)
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Render Data
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct RenderData {
|
2011-11-21 21:19:58 +01:00
|
|
|
struct ImageFormatData im_format;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
struct AviCodecData *avicodecdata;
|
2007-01-09 12:10:12 +01:00
|
|
|
struct FFMpegCodecData ffcodecdata;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Frames as in 'images'. */
|
|
|
|
int cfra, sfra, efra;
|
2023-01-16 03:57:10 +01:00
|
|
|
/** Sub-frame offset from `cfra`, in 0.0-1.0. */
|
2019-01-07 12:19:13 +01:00
|
|
|
float subframe;
|
|
|
|
/** Start+end frames of preview range. */
|
|
|
|
int psfra, pefra;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2007-01-09 12:10:12 +01:00
|
|
|
int images, framapto;
|
2006-11-29 18:01:09 +01:00
|
|
|
short flag, threads;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
float framelen, blurfac;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Frames to jump during render/playback. */
|
|
|
|
int frame_step;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-04-04 09:19:54 +02:00
|
|
|
char _pad10[2];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** For the dimensions presets menu. */
|
|
|
|
short dimensionspreset;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Size in %. */
|
|
|
|
short size;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad6[2];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* From buttons: */
|
2002-10-12 13:37:38 +02:00
|
|
|
/**
|
|
|
|
* The desired number of pixels in the x direction
|
|
|
|
*/
|
2013-02-21 19:07:56 +01:00
|
|
|
int xsch;
|
2002-10-12 13:37:38 +02:00
|
|
|
/**
|
|
|
|
* The desired number of pixels in the y direction
|
|
|
|
*/
|
2013-02-21 19:07:56 +01:00
|
|
|
int ysch;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-11-05 09:05:14 +01:00
|
|
|
/**
|
|
|
|
* render tile dimensions
|
|
|
|
*/
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
int tilex DNA_DEPRECATED;
|
|
|
|
int tiley DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
short planes DNA_DEPRECATED;
|
|
|
|
short imtype DNA_DEPRECATED;
|
|
|
|
short subimtype DNA_DEPRECATED;
|
|
|
|
short quality DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Option to lock the interface while rendering
Added function called WM_set_locked_interface which does
two things:
- Prevents event queue from being handled, so no operators
(see below) or values are even possible to run or change.
This prevents any kind of "destructive" action performed
from user while rendering.
- Locks interface refresh for regions which does have lock
set to truth in their template. Currently it's just a 3D
viewport, but in the future more regions could be considered
unsafe, or we could want to lock different parts of
interface when doing different jobs.
This is needed because 3D viewport could be using or changing
the same data as renderer currently uses, leading to threading
conflict.
Notifiers are still allowed to handle, so render progress is
seen on the screen, but would need to doublecheck on this, in
terms some notifiers could be changing the data.
For now interface locking happens for render job only in case
"Lock Interface" checkbox is enabled.
Other tools like backing would also benefit of this option.
It is possible to mark operator as safe to be used in locked
interface mode by adding OPTYPE_ALLOW_LOCKED bit to operator
template flags.
This bit is completely handled by wm_evem_system, not
with operator run routines, so it's still possible to
run operators from drivers and handlers.
Currently allowed image editor navigation and zooming.
Reviewers: brecht, campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D142
2014-01-29 11:07:14 +01:00
|
|
|
char use_lock_interface;
|
2020-02-15 02:09:03 +01:00
|
|
|
char _pad7[3];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
/**
|
|
|
|
* Flags for render settings. Use bit-masking to access the settings.
|
|
|
|
*/
|
2008-03-21 18:37:24 +01:00
|
|
|
int scemode;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
/**
|
|
|
|
* Flags for render settings. Use bit-masking to access the settings.
|
|
|
|
*/
|
2003-12-10 21:41:53 +01:00
|
|
|
int mode;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-03 04:03:06 +02:00
|
|
|
short frs_sec;
|
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
/**
|
2019-02-07 23:29:08 +01:00
|
|
|
* What to do with the sky/background.
|
2023-01-16 03:57:10 +01:00
|
|
|
* Picks sky/pre-multiply blending for the background.
|
2002-10-12 13:37:38 +02:00
|
|
|
*/
|
2019-05-03 04:03:06 +02:00
|
|
|
char alphamode;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-03 04:03:06 +02:00
|
|
|
char _pad0[1];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-01-16 03:57:10 +01:00
|
|
|
/** Render border to render sub-regions. */
|
2019-09-09 14:36:37 +02:00
|
|
|
rctf border;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Information on different layers to be rendered. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Converted to Scene->view_layers. */
|
|
|
|
ListBase layers DNA_DEPRECATED;
|
|
|
|
/** Converted to Scene->active_layer. */
|
|
|
|
short actlay DNA_DEPRECATED;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad1[2];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2008-04-09 17:46:26 +02:00
|
|
|
/**
|
|
|
|
* Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
|
|
|
|
*/
|
2011-06-11 10:55:29 +02:00
|
|
|
float xasp, yasp;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
== Core ==
This adds fractional FPS support to blender and should finally
make NTSC work correctly.
NTSC has an FPS of 30.0/1.001 which is approximately 29.97 FPS.
Therefore, it is not enough to simply make frs_sec a float, since
you can't represent this accurately enough.
I added a seperate variable frs_sec_base and FPS is now
frs_sec / frs_sec_base.
I changed all the places, where frs_sec was used to my best knowledge.
For convenience sake, I added several macros, that should make life
easier in the future:
FRA2TIME(a) : convert frame number to a double precision time in seconds
TIME2FRA(a) : the same in the opposite direction
FPS : return current FPS as a double precision number
(last resort)
This closes bug #6715
Standard framerates not supported / breaks sync -- 23.967 29.967 etc.
https://projects.blender.org/tracker/?func=detail&aid=6715&group_id=9&atid=125
Please give this heavy testing with NTSC files, quicktime in/export
and the python interface.
Errors are most probably only spotted on longer timelines, so that is
also important.
The patch was tested by Troy Sobotka and me, so it most probably should
work out of the box, but wider testing is important, since errors are
very subtle.
Enjoy!
2007-10-21 17:42:08 +02:00
|
|
|
float frs_sec_base;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
/**
|
2021-06-24 07:56:58 +02:00
|
|
|
* Value used to define filter size for all filter options.
|
|
|
|
*/
|
2007-01-09 12:10:12 +01:00
|
|
|
float gauss;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Color management settings - color profiles, gamma correction, etc. */
|
2009-09-19 00:25:49 +02:00
|
|
|
int color_mgt_flag;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Dither noise intensity. */
|
2004-11-01 16:21:50 +01:00
|
|
|
float dither_intensity;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Bake Render options. */
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
short bake_mode, bake_flag;
|
2022-01-17 18:00:35 +01:00
|
|
|
short bake_margin, bake_samples;
|
|
|
|
short bake_margin_type;
|
|
|
|
char _pad9[6];
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
float bake_biasdist, bake_user_scale;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Path to render output. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** 1024 = FILE_MAX. */
|
Refactor BKE_bpath module.
The main goal of this refactor is to make BPath module use `IDTypeInfo`,
and move each ID-specific part of the `foreach_path` looper into their
own IDTypeInfo struct, using a new `foreach_path` callback.
Additionally, following improvements/cleanups are included:
* Attempt to get better, more consistent namings.
** In particular, move from `path_visitor` to more standard `foreach_path`.
* Update and extend documentation.
** API doc was moved to header, according to recent discussions on this
topic.
* Remove `BKE_bpath_relocate_visitor` from API, this is specific
callback that belongs in `lib_id.c` user code.
NOTE: This commit is expected to be 100% non-behavioral-change. This
implies that several potential further changes were only noted as
comments (like using a more generic solution for
`lib_id_library_local_paths`, addressing inconsistencies like path of
packed libraries always being skipped, regardless of the
`BKE_BPATH_FOREACH_PATH_SKIP_PACKED` `eBPathForeachFlag` flag value,
etc.).
NOTE: basic unittests were added to master already in
rBdcc500e5a265093bc9cc.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D13381
2021-11-29 14:20:58 +01:00
|
|
|
/* NOTE: Excluded from `BKE_bpath_foreach_path_` / `scene_foreach_path` code. */
|
2019-01-07 12:19:13 +01:00
|
|
|
char pic[1024];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Stamps flags. */
|
2007-10-20 18:17:27 +02:00
|
|
|
int stamp;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Select one of blenders bitmap fonts. */
|
2019-02-27 05:07:50 +01:00
|
|
|
short stamp_font_id;
|
|
|
|
char _pad3[2];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Stamp info user data. */
|
2012-01-21 15:54:53 +01:00
|
|
|
char stamp_udata[768];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Foreground/background color. */
|
2007-10-20 18:17:27 +02:00
|
|
|
float fg_stamp[4];
|
|
|
|
float bg_stamp[4];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Sequencer options. */
|
2010-03-16 18:37:34 +01:00
|
|
|
char seq_prev_type;
|
2021-07-27 08:02:22 +02:00
|
|
|
/** UNUSED. */
|
2019-01-07 12:19:13 +01:00
|
|
|
char seq_rend_type;
|
|
|
|
/** Flag use for sequence render/draw. */
|
|
|
|
char seq_flag;
|
2020-10-01 17:58:43 +02:00
|
|
|
char _pad5[3];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Render simplify. */
|
2010-02-02 16:51:44 +01:00
|
|
|
short simplify_subsurf;
|
2015-05-04 13:26:28 +02:00
|
|
|
short simplify_subsurf_render;
|
2018-07-31 10:22:19 +02:00
|
|
|
short simplify_gpencil;
|
2008-02-13 12:18:08 +01:00
|
|
|
float simplify_particles;
|
2015-05-04 13:26:28 +02:00
|
|
|
float simplify_particles_render;
|
2020-10-01 17:58:43 +02:00
|
|
|
float simplify_volumes;
|
2023-02-08 21:08:54 +01:00
|
|
|
float simplify_shadows;
|
|
|
|
float simplify_shadows_render;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Freestyle line thickness options. */
|
2012-04-11 01:53:46 +02:00
|
|
|
int line_thickness_mode;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** In pixels. */
|
|
|
|
float unit_line_thickness;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Render engine. */
|
2018-04-17 13:35:05 +02:00
|
|
|
char engine[32];
|
2020-02-19 01:44:52 +01:00
|
|
|
char _pad2[2];
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Performance Options. */
|
2020-02-19 01:44:52 +01:00
|
|
|
short perf_flag;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Cycles baking. */
|
Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
2014-01-02 22:05:07 +01:00
|
|
|
struct BakeData bake;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
int _pad8;
|
2017-08-15 00:11:52 +02:00
|
|
|
short preview_pixel_size;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
short _pad4;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* MultiView. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** SceneRenderView. */
|
|
|
|
ListBase views;
|
2015-04-06 15:40:12 +02:00
|
|
|
short actview;
|
|
|
|
short views_format;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Hair Display. */
|
2018-05-29 11:20:37 +02:00
|
|
|
short hair_type, hair_subdiv;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Motion blur shutter. */
|
2015-10-27 15:00:51 +01:00
|
|
|
struct CurveMapping mblur_shutter_curve;
|
2002-10-12 13:37:38 +02:00
|
|
|
} RenderData;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RenderData::quality_flag */
|
2020-02-19 01:44:52 +01:00
|
|
|
typedef enum eQualityOption {
|
|
|
|
SCE_PERF_HQ_NORMALS = (1 << 0),
|
|
|
|
} eQualityOption;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RenderData::hair_type */
|
2018-05-29 11:20:37 +02:00
|
|
|
typedef enum eHairType {
|
|
|
|
SCE_HAIR_SHAPE_STRAND = 0,
|
|
|
|
SCE_HAIR_SHAPE_STRIP = 1,
|
|
|
|
} eHairType;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Render Conversion/Simplification Settings
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Control render convert and shading engine. */
|
2008-02-14 19:56:14 +01:00
|
|
|
typedef struct RenderProfile {
|
|
|
|
struct RenderProfile *next, *prev;
|
|
|
|
char name[32];
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2008-02-14 19:56:14 +01:00
|
|
|
short particle_perc;
|
|
|
|
short subsurf_max;
|
|
|
|
short shadbufsample_max;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad1[2];
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2019-02-27 05:07:50 +01:00
|
|
|
float ao_error;
|
|
|
|
char _pad2[4];
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2008-02-14 19:56:14 +01:00
|
|
|
} RenderProfile;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* UV Paint. */
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::uv_sculpt_settings */
|
|
|
|
enum {
|
|
|
|
UV_SCULPT_LOCK_BORDERS = 1,
|
|
|
|
UV_SCULPT_ALL_ISLANDS = 2,
|
|
|
|
};
|
2012-01-17 17:31:13 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::uv_relax_method */
|
|
|
|
enum {
|
|
|
|
UV_SCULPT_TOOL_RELAX_LAPLACIAN = 1,
|
|
|
|
UV_SCULPT_TOOL_RELAX_HC = 2,
|
|
|
|
UV_SCULPT_TOOL_RELAX_COTAN = 3,
|
|
|
|
};
|
2012-01-17 17:31:13 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Stereo Flags. */
|
2015-04-06 15:40:12 +02:00
|
|
|
#define STEREO_RIGHT_NAME "right"
|
|
|
|
#define STEREO_LEFT_NAME "left"
|
|
|
|
#define STEREO_RIGHT_SUFFIX "_R"
|
|
|
|
#define STEREO_LEFT_SUFFIX "_L"
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #View3D::stereo3d_camera / #View3D::multiview_eye / #ImageUser::multiview_eye */
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum eStereoViews {
|
2015-04-06 15:40:12 +02:00
|
|
|
STEREO_LEFT_ID = 0,
|
|
|
|
STEREO_RIGHT_ID = 1,
|
|
|
|
STEREO_3D_ID = 2,
|
|
|
|
STEREO_MONO_ID = 3,
|
2017-10-17 04:43:10 +02:00
|
|
|
} eStereoViews;
|
2015-04-06 15:40:12 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Time Line Markers
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2018-01-18 03:50:52 +01:00
|
|
|
typedef struct TimeMarker {
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 19:19:21 +02:00
|
|
|
struct TimeMarker *next, *prev;
|
|
|
|
int frame;
|
|
|
|
char name[64];
|
|
|
|
unsigned int flag;
|
2009-12-16 20:49:33 +01:00
|
|
|
struct Object *camera;
|
2020-09-18 16:57:33 +02:00
|
|
|
struct IDProperty *prop;
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 19:19:21 +02:00
|
|
|
} TimeMarker;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Paint Mode/Tool Data
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2012-05-22 01:32:46 +02:00
|
|
|
#define PAINT_MAX_INPUT_SAMPLES 64
|
|
|
|
|
2018-11-05 06:18:43 +01:00
|
|
|
typedef struct Paint_Runtime {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Avoid having to compare with scene pointer everywhere. */
|
2018-11-05 06:18:43 +01:00
|
|
|
unsigned int tool_offset;
|
|
|
|
unsigned short ob_mode;
|
|
|
|
char _pad[2];
|
|
|
|
} Paint_Runtime;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** We might want to store other things here. */
|
2018-11-01 23:10:23 +01:00
|
|
|
typedef struct PaintToolSlot {
|
|
|
|
struct Brush *brush;
|
|
|
|
} PaintToolSlot;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Paint Tool Base. */
|
2009-09-19 00:25:49 +02:00
|
|
|
typedef struct Paint {
|
2010-08-04 14:18:07 +02:00
|
|
|
struct Brush *brush;
|
2018-11-01 23:10:23 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
|
|
|
* Each tool has its own active brush,
|
|
|
|
* The currently active tool is defined by the current 'brush'.
|
|
|
|
*/
|
2018-11-01 23:10:23 +01:00
|
|
|
struct PaintToolSlot *tool_slots;
|
|
|
|
int tool_slots_len;
|
|
|
|
char _pad1[4];
|
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
struct Palette *palette;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Cavity curve. */
|
|
|
|
struct CurveMapping *cavity_curve;
|
2014-07-21 12:02:05 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** WM Paint cursor. */
|
2009-09-19 00:25:49 +02:00
|
|
|
void *paint_cursor;
|
|
|
|
unsigned char paint_cursor_col[4];
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Enum #ePaintFlags. */
|
2009-11-03 23:50:09 +01:00
|
|
|
int flags;
|
2012-05-22 01:32:46 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Paint stroke can use up to PAINT_MAX_INPUT_SAMPLES inputs to smooth the stroke. */
|
2012-05-22 01:32:46 +02:00
|
|
|
int num_input_samples;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Flags used for symmetry. */
|
2013-12-09 21:36:33 +01:00
|
|
|
int symmetry_flags;
|
2015-07-23 22:52:03 +02:00
|
|
|
|
|
|
|
float tile_offset[3];
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad2[4];
|
2018-11-05 06:18:43 +01:00
|
|
|
|
|
|
|
struct Paint_Runtime runtime;
|
2009-09-19 00:25:49 +02:00
|
|
|
} Paint;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Image Paint
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Texture/Image Editor. */
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
typedef struct ImagePaintSettings {
|
2009-09-19 00:25:49 +02:00
|
|
|
Paint paint;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-10-06 15:12:06 +02:00
|
|
|
short flag, missing_data;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** For projection painting only. */
|
2009-09-19 00:25:49 +02:00
|
|
|
short seam_bleed, normal_angle;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Capture size for re-projection. */
|
|
|
|
short screen_grab_size[2];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Mode used for texture painting. */
|
|
|
|
int mode;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Workaround until we support true layer masks. */
|
|
|
|
struct Image *stencil;
|
|
|
|
/** Clone layer for image mode for projective texture painting. */
|
|
|
|
struct Image *clone;
|
|
|
|
/** Canvas when the explicit system is used for painting. */
|
|
|
|
struct Image *canvas;
|
2014-07-21 12:02:05 +02:00
|
|
|
float stencil_col[3];
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Dither amount used when painting on byte images. */
|
|
|
|
float dither;
|
2018-12-23 16:26:21 +01:00
|
|
|
/** Display texture interpolation method. */
|
|
|
|
int interp;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad[4];
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
} ImagePaintSettings;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Paint Mode Settings
|
|
|
|
* \{ */
|
2022-04-08 16:37:35 +02:00
|
|
|
|
|
|
|
typedef struct PaintModeSettings {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Source to select canvas from to paint on (#ePaintCanvasSource). */
|
2022-04-08 16:37:35 +02:00
|
|
|
char canvas_source;
|
|
|
|
char _pad[7];
|
|
|
|
|
|
|
|
/** Selected image when canvas_source=PAINT_CANVAS_SOURCE_IMAGE. */
|
|
|
|
Image *canvas_image;
|
2022-04-15 16:39:50 +02:00
|
|
|
ImageUser image_user;
|
2022-04-08 16:37:35 +02:00
|
|
|
|
|
|
|
} PaintModeSettings;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Particle Edit
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Settings for a Particle Editing Brush. */
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
typedef struct ParticleBrushData {
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Common setting. */
|
|
|
|
short size;
|
|
|
|
/** For specific brushes only. */
|
|
|
|
short step, invert, count;
|
2010-03-22 18:12:08 +01:00
|
|
|
int flag;
|
|
|
|
float strength;
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
} ParticleBrushData;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Particle Edit Mode Settings. */
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
typedef struct ParticleEditSettings {
|
|
|
|
short flag;
|
|
|
|
short totrekey;
|
|
|
|
short totaddkey;
|
|
|
|
short brushtype;
|
|
|
|
|
2018-01-18 04:02:26 +01:00
|
|
|
ParticleBrushData brush[7];
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Runtime. */
|
|
|
|
void *paintcursor;
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2021-05-12 08:44:59 +02:00
|
|
|
float emitterdist;
|
|
|
|
char _pad0[4];
|
2009-09-19 00:25:49 +02:00
|
|
|
|
|
|
|
int selectmode;
|
|
|
|
int edittype;
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
|
2009-09-19 00:25:49 +02:00
|
|
|
int draw_step, fade_frames;
|
|
|
|
|
|
|
|
struct Scene *scene;
|
|
|
|
struct Object *object;
|
2014-10-22 16:36:23 +02:00
|
|
|
struct Object *shape_object;
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
} ParticleEditSettings;
|
2006-08-30 12:43:51 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Sculpt
|
|
|
|
* \{ */
|
=== Custom Transform Orientation ===
Custom Orientations can be added with Ctrl-Shift-C (hotkey suggestions are welcomed), this adds and select the new alignment. Custom Orientations can also be added, deleted, selected from the Transform Orientations panel (View -> Transform Orientations). Standard orientations (global, local, normal, view) can also be selected from this panel.
If you plan on using only a single custom orientation and don't really need a list, I suggest you use the hotkey as it adds and selects at the same time.
Custom Orientations are save in the scene and are selected per 3D view (like normal orientation).
Adding from an object, the orientation is a normalized version of the object's orientation.
Adding from mesh data, a single element (vertex, edge, face) must be selected in its respective selection mode. Vertex orientation Z-axis is based on the normal, edge Z-axis on the edge itself (X-axis is on the XoY plane when possible, Y-axis is perpendicular to the rest). Face orientation Z-axis is the face normal, X-axis is perpendicular to the first edge, Y-axis is perpendicular to the rest.
(More logical orientations can be suggested).
I plan to add: 2 vertice (connected or not) => edge orientation , 3 vertice = face orientation
Differences from the patch:
- orientations no longer link back to the object they came from, everything is copy on creation.
- orientations are overwritten based on name (if you add an orientation with the same name as one that already exists, it overwrites the old one)
2008-01-13 19:24:09 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Sculpt. */
|
2009-09-19 00:25:49 +02:00
|
|
|
typedef struct Sculpt {
|
|
|
|
Paint paint;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** For rotating around a pivot point. */
|
2019-05-01 03:09:22 +02:00
|
|
|
// float pivot[3]; XXX not used?
|
2009-09-19 00:25:49 +02:00
|
|
|
int flags;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Transform tool. */
|
2022-06-04 04:21:04 +02:00
|
|
|
int transform_mode;
|
|
|
|
|
2020-04-02 16:56:05 +02:00
|
|
|
int automasking_flags;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
// /* Control tablet input. */
|
2019-05-01 03:09:22 +02:00
|
|
|
// char tablet_size, tablet_strength; XXX not used?
|
2010-07-14 16:11:03 +02:00
|
|
|
int radial_symm[3];
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Maximum edge length for dynamic topology sculpting (in pixels). */
|
2014-03-31 18:30:51 +02:00
|
|
|
float detail_size;
|
2012-12-30 19:31:01 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Direction used for `SCULPT_OT_symmetrize` operator. */
|
2012-12-30 19:31:01 +01:00
|
|
|
int symmetrize_direction;
|
2013-12-12 18:01:11 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Gravity factor for sculpting. */
|
2013-12-12 18:01:11 +01:00
|
|
|
float gravity_factor;
|
2014-03-22 16:47:18 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Scale for constant detail size. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Constant detail resolution (Blender unit / constant_detail). */
|
|
|
|
float constant_detail;
|
2015-05-06 22:51:49 +02:00
|
|
|
float detail_percent;
|
2013-12-12 18:01:11 +01:00
|
|
|
|
2022-09-29 01:22:34 +02:00
|
|
|
int automasking_cavity_blur_steps;
|
|
|
|
float automasking_cavity_factor;
|
2022-06-04 04:21:04 +02:00
|
|
|
char _pad[4];
|
|
|
|
|
2022-09-29 08:21:56 +02:00
|
|
|
float automasking_start_normal_limit, automasking_start_normal_falloff;
|
|
|
|
float automasking_view_normal_limit, automasking_view_normal_falloff;
|
|
|
|
|
2022-09-29 01:22:34 +02:00
|
|
|
struct CurveMapping *automasking_cavity_curve;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** For use by operators. */
|
|
|
|
struct CurveMapping *automasking_cavity_curve_op;
|
2013-12-12 18:01:11 +01:00
|
|
|
struct Object *gravity_object;
|
2009-09-19 00:25:49 +02:00
|
|
|
} Sculpt;
|
|
|
|
|
2022-02-18 09:12:41 +01:00
|
|
|
typedef struct CurvesSculpt {
|
|
|
|
Paint paint;
|
|
|
|
} CurvesSculpt;
|
|
|
|
|
2012-01-17 17:31:13 +01:00
|
|
|
typedef struct UvSculpt {
|
|
|
|
Paint paint;
|
|
|
|
} UvSculpt;
|
2015-12-13 09:03:13 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Grease pencil drawing brushes. */
|
2018-07-31 10:22:19 +02:00
|
|
|
typedef struct GpPaint {
|
|
|
|
Paint paint;
|
2020-03-09 16:27:24 +01:00
|
|
|
int flag;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Mode of paint (Materials or Vertex Color). */
|
2020-03-09 16:27:24 +01:00
|
|
|
int mode;
|
2018-07-31 10:22:19 +02:00
|
|
|
} GpPaint;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #GpPaint::flag */
|
2020-03-09 16:27:24 +01:00
|
|
|
enum {
|
|
|
|
GPPAINT_FLAG_USE_MATERIAL = 0,
|
|
|
|
GPPAINT_FLAG_USE_VERTEXCOLOR = 1,
|
|
|
|
};
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Grease pencil vertex paint. */
|
2020-03-09 16:27:24 +01:00
|
|
|
typedef struct GpVertexPaint {
|
|
|
|
Paint paint;
|
|
|
|
int flag;
|
|
|
|
char _pad[4];
|
|
|
|
} GpVertexPaint;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Grease pencil sculpt paint. */
|
2020-03-09 16:27:24 +01:00
|
|
|
typedef struct GpSculptPaint {
|
|
|
|
Paint paint;
|
|
|
|
int flag;
|
|
|
|
char _pad[4];
|
|
|
|
} GpSculptPaint;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Grease pencil weight paint. */
|
2020-03-09 16:27:24 +01:00
|
|
|
typedef struct GpWeightPaint {
|
|
|
|
Paint paint;
|
|
|
|
int flag;
|
|
|
|
char _pad[4];
|
|
|
|
} GpWeightPaint;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Vertex Paint
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Vertex Paint. */
|
2009-09-19 00:25:49 +02:00
|
|
|
typedef struct VPaint {
|
|
|
|
Paint paint;
|
2017-10-06 11:11:17 +02:00
|
|
|
char flag;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad[3];
|
2019-01-07 12:19:13 +01:00
|
|
|
/** For mirrored painting. */
|
|
|
|
int radial_symm[3];
|
2009-09-19 00:25:49 +02:00
|
|
|
} VPaint;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #VPaint::flag */
|
2012-09-23 20:50:56 +02:00
|
|
|
enum {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Weight paint only. */
|
2019-01-15 13:57:49 +01:00
|
|
|
VP_FLAG_VGROUP_RESTRICT = (1 << 7),
|
2017-10-02 12:07:25 +02:00
|
|
|
};
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Grease-Pencil Stroke Sculpting
|
|
|
|
* \{ */
|
2015-12-13 09:03:13 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #GP_Sculpt_Settings::lock_axis */
|
2016-10-22 16:44:11 +02:00
|
|
|
typedef enum eGP_Lockaxis_Types {
|
2018-11-04 13:00:19 +01:00
|
|
|
GP_LOCKAXIS_VIEW = 0,
|
2016-10-22 16:44:11 +02:00
|
|
|
GP_LOCKAXIS_X = 1,
|
|
|
|
GP_LOCKAXIS_Y = 2,
|
2019-01-15 13:57:49 +01:00
|
|
|
GP_LOCKAXIS_Z = 3,
|
2019-04-16 16:40:47 +02:00
|
|
|
GP_LOCKAXIS_CURSOR = 4,
|
2016-10-22 16:44:11 +02:00
|
|
|
} eGP_Lockaxis_Types;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Settings for a GPencil Speed Guide. */
|
2019-01-11 19:15:23 +01:00
|
|
|
typedef struct GP_Sculpt_Guide {
|
|
|
|
char use_guide;
|
|
|
|
char use_snapping;
|
|
|
|
char reference_point;
|
|
|
|
char type;
|
|
|
|
char _pad2[4];
|
|
|
|
float angle;
|
|
|
|
float angle_snap;
|
|
|
|
float spacing;
|
|
|
|
float location[3];
|
|
|
|
struct Object *reference_object;
|
|
|
|
} GP_Sculpt_Guide;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** GPencil Stroke Sculpting Settings. */
|
2018-11-18 19:28:54 +01:00
|
|
|
typedef struct GP_Sculpt_Settings {
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Runtime. */
|
|
|
|
void *paintcursor;
|
2019-01-07 15:00:40 +01:00
|
|
|
/** #eGP_Sculpt_SettingsFlag. */
|
2019-01-07 12:19:13 +01:00
|
|
|
int flag;
|
2019-01-07 15:00:40 +01:00
|
|
|
/** #eGP_Lockaxis_Types lock drawing to one axis. */
|
2019-01-07 12:19:13 +01:00
|
|
|
int lock_axis;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Threshold for intersections. */
|
2019-01-11 19:15:23 +01:00
|
|
|
float isect_threshold;
|
2020-11-13 21:43:00 +01:00
|
|
|
char _pad[4];
|
2022-03-30 02:38:24 +02:00
|
|
|
/** Multi-frame edit falloff effect by frame. */
|
2019-01-07 12:19:13 +01:00
|
|
|
struct CurveMapping *cur_falloff;
|
2019-08-01 05:53:25 +02:00
|
|
|
/** Curve used for primitive tools. */
|
2019-01-07 12:19:13 +01:00
|
|
|
struct CurveMapping *cur_primitive;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Guides used for paint tools. */
|
2019-01-11 19:15:23 +01:00
|
|
|
struct GP_Sculpt_Guide guide;
|
2018-11-18 19:28:54 +01:00
|
|
|
} GP_Sculpt_Settings;
|
2015-12-13 09:03:13 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #GP_Sculpt_Settings::flag */
|
2018-11-18 19:28:54 +01:00
|
|
|
typedef enum eGP_Sculpt_SettingsFlag {
|
2021-02-13 07:44:51 +01:00
|
|
|
/** Enable falloff for multi-frame editing. */
|
2020-03-09 16:27:24 +01:00
|
|
|
GP_SCULPT_SETT_FLAG_FRAME_FALLOFF = (1 << 0),
|
2021-02-13 07:44:51 +01:00
|
|
|
/** Apply primitive curve. */
|
2020-03-09 16:27:24 +01:00
|
|
|
GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE = (1 << 1),
|
2021-02-13 07:44:51 +01:00
|
|
|
/** Scale thickness. */
|
2020-03-09 16:27:24 +01:00
|
|
|
GP_SCULPT_SETT_FLAG_SCALE_THICKNESS = (1 << 3),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Stroke Auto-Masking for sculpt. */
|
2022-11-08 16:55:59 +01:00
|
|
|
GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE = (1 << 4),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Stroke Layer Auto-Masking for sculpt. */
|
2022-11-08 16:55:59 +01:00
|
|
|
GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE = (1 << 5),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Stroke Material Auto-Masking for sculpt. */
|
2022-11-08 16:55:59 +01:00
|
|
|
GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE = (1 << 6),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Active Layer Auto-Masking for sculpt. */
|
2022-11-08 16:55:59 +01:00
|
|
|
GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE = (1 << 7),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Active Material Auto-Masking for sculpt. */
|
2022-11-08 16:55:59 +01:00
|
|
|
GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE = (1 << 8),
|
2018-11-18 19:28:54 +01:00
|
|
|
} eGP_Sculpt_SettingsFlag;
|
2017-01-18 04:43:17 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #GP_Sculpt_Settings::gpencil_selectmode_sculpt */
|
2019-08-17 16:18:09 +02:00
|
|
|
typedef enum eGP_Sculpt_SelectMaskFlag {
|
2021-02-13 07:44:51 +01:00
|
|
|
/** Only affect selected points. */
|
2019-08-17 16:18:09 +02:00
|
|
|
GP_SCULPT_MASK_SELECTMODE_POINT = (1 << 0),
|
2021-02-13 07:44:51 +01:00
|
|
|
/** Only affect selected strokes. */
|
2019-08-17 16:18:09 +02:00
|
|
|
GP_SCULPT_MASK_SELECTMODE_STROKE = (1 << 1),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Only affect selected segments. */
|
2019-08-17 16:18:09 +02:00
|
|
|
GP_SCULPT_MASK_SELECTMODE_SEGMENT = (1 << 2),
|
|
|
|
} eGP_Sculpt_SelectMaskFlag;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #GP_Sculpt_Settings::gpencil_selectmode_vertex */
|
2020-03-09 16:27:24 +01:00
|
|
|
typedef enum eGP_vertex_SelectMaskFlag {
|
2021-02-13 07:44:51 +01:00
|
|
|
/** Only affect selected points. */
|
2020-03-09 16:27:24 +01:00
|
|
|
GP_VERTEX_MASK_SELECTMODE_POINT = (1 << 0),
|
2021-02-13 07:44:51 +01:00
|
|
|
/** Only affect selected strokes. */
|
2020-03-09 16:27:24 +01:00
|
|
|
GP_VERTEX_MASK_SELECTMODE_STROKE = (1 << 1),
|
2021-02-13 07:44:51 +01:00
|
|
|
/** Only affect selected segments. */
|
2020-03-09 16:27:24 +01:00
|
|
|
GP_VERTEX_MASK_SELECTMODE_SEGMENT = (1 << 2),
|
|
|
|
} eGP_Vertex_SelectMaskFlag;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Settings for GP Interpolation Operators. */
|
2017-01-18 04:43:17 +01:00
|
|
|
typedef struct GP_Interpolate_Settings {
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Custom interpolation curve (for use with GP_IPO_CURVEMAP). */
|
|
|
|
struct CurveMapping *custom_ipo;
|
2017-01-18 04:43:17 +01:00
|
|
|
} GP_Interpolate_Settings;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #GP_Interpolate_Settings::flag */
|
2017-01-18 04:43:17 +01:00
|
|
|
typedef enum eGP_Interpolate_SettingsFlag {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Apply interpolation to all layers. */
|
2017-01-18 04:43:17 +01:00
|
|
|
GP_TOOLFLAG_INTERPOLATE_ALL_LAYERS = (1 << 0),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Apply interpolation to only selected. */
|
2017-01-18 04:43:17 +01:00
|
|
|
GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED = (1 << 1),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Exclude breakdown keyframe type as extreme. */
|
2022-11-28 19:32:18 +01:00
|
|
|
GP_TOOLFLAG_INTERPOLATE_EXCLUDE_BREAKDOWNS = (1 << 2),
|
2017-01-18 04:43:17 +01:00
|
|
|
} eGP_Interpolate_SettingsFlag;
|
2016-08-03 23:31:48 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #GP_Interpolate_Settings::type */
|
2017-01-18 07:00:17 +01:00
|
|
|
typedef enum eGP_Interpolate_Type {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Traditional Linear Interpolation. */
|
2017-01-18 07:00:17 +01:00
|
|
|
GP_IPO_LINEAR = 0,
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** CurveMap Defined Interpolation. */
|
2017-01-18 07:00:17 +01:00
|
|
|
GP_IPO_CURVEMAP = 1,
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Easing Equations. */
|
2017-01-18 07:00:17 +01:00
|
|
|
GP_IPO_BACK = 3,
|
|
|
|
GP_IPO_BOUNCE = 4,
|
|
|
|
GP_IPO_CIRC = 5,
|
|
|
|
GP_IPO_CUBIC = 6,
|
|
|
|
GP_IPO_ELASTIC = 7,
|
|
|
|
GP_IPO_EXPO = 8,
|
|
|
|
GP_IPO_QUAD = 9,
|
|
|
|
GP_IPO_QUART = 10,
|
|
|
|
GP_IPO_QUINT = 11,
|
|
|
|
GP_IPO_SINE = 12,
|
|
|
|
} eGP_Interpolate_Type;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
2012-01-12 18:22:32 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Unified Paint Settings
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* These settings can override the equivalent fields in the active
|
2012-03-09 19:28:30 +01:00
|
|
|
* Brush for any paint mode; the flag field controls whether these
|
2022-12-15 00:31:18 +01:00
|
|
|
* values are used
|
|
|
|
*/
|
2012-01-12 18:22:32 +01:00
|
|
|
typedef struct UnifiedPaintSettings {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Unified radius of brush in pixels. */
|
2012-01-12 18:22:32 +01:00
|
|
|
int size;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Unified radius of brush in Blender units. */
|
2012-01-12 18:22:32 +01:00
|
|
|
float unprojected_radius;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Unified strength of brush. */
|
2012-04-29 22:04:25 +02:00
|
|
|
float alpha;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Unified brush weight, [0, 1]. */
|
2014-07-21 12:02:05 +02:00
|
|
|
float weight;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Unified brush color. */
|
2012-01-12 18:22:32 +01:00
|
|
|
float rgb[3];
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Unified brush secondary color. */
|
2012-01-12 18:22:32 +01:00
|
|
|
float secondary_rgb[3];
|
2013-01-16 04:20:36 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** User preferences for sculpt and paint. */
|
2018-05-16 19:34:24 +02:00
|
|
|
int flag;
|
2013-01-16 04:20:36 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Rake rotation. */
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Record movement of mouse so that rake can start at an intuitive angle. */
|
2013-03-13 04:46:22 +01:00
|
|
|
float last_rake[2];
|
2014-12-29 11:35:22 +01:00
|
|
|
float last_rake_angle;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2014-12-29 11:35:22 +01:00
|
|
|
int last_stroke_valid;
|
|
|
|
float average_stroke_accum[3];
|
|
|
|
int average_stroke_counter;
|
2013-01-16 04:20:36 +01:00
|
|
|
|
2013-03-13 04:46:22 +01:00
|
|
|
float brush_rotation;
|
2014-12-26 23:51:27 +01:00
|
|
|
float brush_rotation_sec;
|
2013-01-16 04:20:36 +01:00
|
|
|
|
2018-09-02 10:28:27 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
* all data below are used to communicate with cursor drawing and tex sampling *
|
|
|
|
*******************************************************************************/
|
2014-07-21 12:02:05 +02:00
|
|
|
int anchored_size;
|
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/**
|
|
|
|
* Normalization factor due to accumulated value of curve along spacing.
|
|
|
|
* Calculated when brush spacing changes to dampen strength of stroke
|
|
|
|
* if space attenuation is used.
|
|
|
|
*/
|
|
|
|
float overlap_factor;
|
2014-12-26 23:51:27 +01:00
|
|
|
char draw_inverted;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Check is there an ongoing stroke right now. */
|
2014-12-26 23:51:27 +01:00
|
|
|
char stroke_active;
|
|
|
|
|
|
|
|
char draw_anchored;
|
|
|
|
char do_linear_conversion;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
|
|
|
* Store last location of stroke or whether the mesh was hit.
|
|
|
|
* Valid only while stroke is active.
|
|
|
|
*/
|
2015-11-24 21:40:18 +01:00
|
|
|
float last_location[3];
|
|
|
|
int last_hit;
|
|
|
|
|
2013-01-16 04:20:36 +01:00
|
|
|
float anchored_initial_mouse[2];
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
|
|
|
* Radius of brush, pre-multiplied with pressure.
|
|
|
|
* In case of anchored brushes contains the anchored radius.
|
|
|
|
*/
|
2014-12-26 23:51:27 +01:00
|
|
|
float pixel_radius;
|
2019-12-01 20:29:11 +01:00
|
|
|
float initial_pixel_radius;
|
2022-05-15 09:33:22 +02:00
|
|
|
float start_pixel_radius;
|
2013-12-09 21:36:33 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Drawing pressure. */
|
2014-04-13 17:14:45 +02:00
|
|
|
float size_pressure_value;
|
2013-03-13 04:46:22 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Position of mouse, used to sample the texture. */
|
2013-03-13 04:46:22 +01:00
|
|
|
float tex_mouse[2];
|
2013-04-22 12:46:01 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Position of mouse, used to sample the mask texture. */
|
2013-04-22 12:46:01 +02:00
|
|
|
float mask_tex_mouse[2];
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** ColorSpace cache to avoid locking up during sampling. */
|
2014-04-13 18:03:14 +02:00
|
|
|
struct ColorSpace *colorspace;
|
2012-01-12 18:22:32 +01:00
|
|
|
} UnifiedPaintSettings;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #UnifiedPaintSettings::flag */
|
2012-01-12 18:22:32 +01:00
|
|
|
typedef enum {
|
2013-04-13 02:43:49 +02:00
|
|
|
UNIFIED_PAINT_SIZE = (1 << 0),
|
|
|
|
UNIFIED_PAINT_ALPHA = (1 << 1),
|
|
|
|
UNIFIED_PAINT_WEIGHT = (1 << 5),
|
2014-07-21 12:02:05 +02:00
|
|
|
UNIFIED_PAINT_COLOR = (1 << 6),
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Only used if unified size is enabled, mirrors the brush flag #BRUSH_LOCK_SIZE. */
|
2013-04-13 02:43:49 +02:00
|
|
|
UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1 << 2),
|
2019-11-27 02:02:18 +01:00
|
|
|
UNIFIED_PAINT_FLAG_UNUSED_0 = (1 << 3),
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-11-27 02:02:18 +01:00
|
|
|
UNIFIED_PAINT_FLAG_UNUSED_1 = (1 << 4),
|
2017-10-17 04:43:10 +02:00
|
|
|
} eUnifiedPaintSettingsFlags;
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2016-04-15 10:10:05 +02:00
|
|
|
typedef struct CurvePaintSettings {
|
|
|
|
char curve_type;
|
|
|
|
char flag;
|
|
|
|
char depth_mode;
|
|
|
|
char surface_plane;
|
2016-07-25 06:14:31 +02:00
|
|
|
char fit_method;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad;
|
2016-07-25 06:14:31 +02:00
|
|
|
short error_threshold;
|
2016-04-15 10:10:05 +02:00
|
|
|
float radius_min, radius_max;
|
|
|
|
float radius_taper_start, radius_taper_end;
|
2016-05-04 07:45:55 +02:00
|
|
|
float surface_offset;
|
2016-04-15 10:10:05 +02:00
|
|
|
float corner_angle;
|
|
|
|
} CurvePaintSettings;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #CurvePaintSettings::flag */
|
2016-04-15 10:10:05 +02:00
|
|
|
enum {
|
|
|
|
CURVE_PAINT_FLAG_CORNERS_DETECT = (1 << 0),
|
|
|
|
CURVE_PAINT_FLAG_PRESSURE_RADIUS = (1 << 1),
|
|
|
|
CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS = (1 << 2),
|
2016-05-04 07:45:55 +02:00
|
|
|
CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS = (1 << 3),
|
2016-04-15 10:10:05 +02:00
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #CurvePaintSettings::fit_method */
|
2016-07-25 06:14:31 +02:00
|
|
|
enum {
|
|
|
|
CURVE_PAINT_FIT_METHOD_REFIT = 0,
|
|
|
|
CURVE_PAINT_FIT_METHOD_SPLIT = 1,
|
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #CurvePaintSettings::depth_mode */
|
2016-04-15 10:10:05 +02:00
|
|
|
enum {
|
|
|
|
CURVE_PAINT_PROJECT_CURSOR = 0,
|
|
|
|
CURVE_PAINT_PROJECT_SURFACE = 1,
|
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #CurvePaintSettings::surface_plane */
|
2016-04-15 10:10:05 +02:00
|
|
|
enum {
|
|
|
|
CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW = 0,
|
|
|
|
CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE = 1,
|
|
|
|
CURVE_PAINT_SURFACE_PLANE_VIEW = 2,
|
|
|
|
};
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Mesh Visualization
|
|
|
|
* \{ */
|
2015-12-13 09:03:13 +01:00
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** Stats for Meshes. */
|
2013-04-17 11:27:23 +02:00
|
|
|
typedef struct MeshStatVis {
|
|
|
|
char type;
|
|
|
|
char _pad1[2];
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Overhang. */
|
2013-04-17 11:27:23 +02:00
|
|
|
char overhang_axis;
|
|
|
|
float overhang_min, overhang_max;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Thickness. */
|
2013-04-17 11:27:23 +02:00
|
|
|
float thickness_min, thickness_max;
|
|
|
|
char thickness_samples;
|
|
|
|
char _pad2[3];
|
2013-04-18 06:24:18 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Distort. */
|
2013-04-18 06:24:18 +02:00
|
|
|
float distort_min, distort_max;
|
2013-04-18 19:09:56 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Sharp. */
|
2013-04-18 19:09:56 +02:00
|
|
|
float sharp_min, sharp_max;
|
2013-04-17 11:27:23 +02:00
|
|
|
} MeshStatVis;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Sequencer Tool Settings
|
|
|
|
* \{ */
|
|
|
|
|
2020-12-16 20:34:26 +01:00
|
|
|
typedef struct SequencerToolSettings {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** #eSeqImageFitMethod. */
|
2020-12-16 20:34:26 +01:00
|
|
|
int fit_method;
|
2021-06-29 20:12:19 +02:00
|
|
|
short snap_mode;
|
|
|
|
short snap_flag;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** #eSeqOverlapMode. */
|
2021-08-27 12:59:46 +02:00
|
|
|
int overlap_mode;
|
2022-01-06 03:54:52 +01:00
|
|
|
/**
|
|
|
|
* When there are many snap points,
|
|
|
|
* 0-1 range corresponds to resolution from bound-box to all possible snap points.
|
|
|
|
*/
|
2021-06-29 20:12:19 +02:00
|
|
|
int snap_distance;
|
2021-09-21 09:38:30 +02:00
|
|
|
int pivot_point;
|
2020-12-16 20:34:26 +01:00
|
|
|
} SequencerToolSettings;
|
|
|
|
|
2021-08-27 12:59:46 +02:00
|
|
|
typedef enum eSeqOverlapMode {
|
|
|
|
SEQ_OVERLAP_EXPAND,
|
|
|
|
SEQ_OVERLAP_OVERWRITE,
|
|
|
|
SEQ_OVERLAP_SHUFFLE,
|
|
|
|
} eSeqOverlapMode;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Tool Settings
|
|
|
|
* \{ */
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #CurvePaintSettings::surface_plane */
|
2019-08-26 19:15:25 +02:00
|
|
|
enum {
|
|
|
|
AUTO_MERGE = 1 << 0,
|
|
|
|
AUTO_MERGE_AND_SPLIT = 1 << 1,
|
|
|
|
};
|
|
|
|
|
2005-08-24 22:37:25 +02:00
|
|
|
typedef struct ToolSettings {
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Vertex paint. */
|
|
|
|
VPaint *vpaint;
|
|
|
|
/** Weight paint. */
|
|
|
|
VPaint *wpaint;
|
2009-09-19 00:25:49 +02:00
|
|
|
Sculpt *sculpt;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Uv smooth. */
|
|
|
|
UvSculpt *uvsculpt;
|
|
|
|
/** Gpencil paint. */
|
|
|
|
GpPaint *gp_paint;
|
2020-03-09 16:27:24 +01:00
|
|
|
/** Gpencil vertex paint. */
|
|
|
|
GpVertexPaint *gp_vertexpaint;
|
|
|
|
/** Gpencil sculpt paint. */
|
|
|
|
GpSculptPaint *gp_sculptpaint;
|
|
|
|
/** Gpencil weight paint. */
|
|
|
|
GpWeightPaint *gp_weightpaint;
|
2022-02-18 09:12:41 +01:00
|
|
|
/** Curves sculpt. */
|
|
|
|
CurvesSculpt *curves_sculpt;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Vertex group weight - used only for editmode, not weight paint. */
|
2009-09-19 00:25:49 +02:00
|
|
|
float vgroup_weight;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Remove doubles limit. */
|
|
|
|
float doublimit;
|
2018-06-18 20:40:41 +02:00
|
|
|
char automerge;
|
|
|
|
char object_flag;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Selection Mode for Mesh. */
|
2022-02-16 03:46:00 +01:00
|
|
|
char selectmode;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* UV Calculation. */
|
2013-10-08 15:07:09 +02:00
|
|
|
char unwrapper;
|
|
|
|
char uvcalc_flag;
|
|
|
|
char uv_flag;
|
|
|
|
char uv_selectmode;
|
2022-02-16 03:46:00 +01:00
|
|
|
char uv_sticky;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-09-19 00:25:49 +02:00
|
|
|
float uvcalc_margin;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Auto-IK. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Runtime only. */
|
|
|
|
short autoik_chainlen;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Grease Pencil. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Flags/options for how the tool works. */
|
|
|
|
char gpencil_flags;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Stroke placement settings: 3D View. */
|
|
|
|
char gpencil_v3d_align;
|
|
|
|
/** General 2D Editor. */
|
|
|
|
char gpencil_v2d_align;
|
2021-07-27 00:52:48 +02:00
|
|
|
char _pad0[2];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Annotations. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Stroke placement settings - 3D View. */
|
|
|
|
char annotate_v3d_align;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Default stroke thickness for annotation strokes. */
|
|
|
|
short annotate_thickness;
|
2019-08-17 16:18:09 +02:00
|
|
|
/** Stroke selection mode for Edit. */
|
|
|
|
char gpencil_selectmode_edit;
|
|
|
|
/** Stroke selection mode for Sculpt. */
|
|
|
|
char gpencil_selectmode_sculpt;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Grease Pencil Sculpt. */
|
2018-11-18 19:28:54 +01:00
|
|
|
struct GP_Sculpt_Settings gp_sculpt;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Grease Pencil Interpolation Tool(s). */
|
2017-01-18 04:43:17 +01:00
|
|
|
struct GP_Interpolate_Settings gp_interpolate;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Image Paint (8 bytes aligned please!). */
|
2007-04-24 16:52:35 +02:00
|
|
|
struct ImagePaintSettings imapaint;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
/** Settings for paint mode. */
|
|
|
|
struct PaintModeSettings paint_mode;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Particle Editing. */
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 23:09:57 +01:00
|
|
|
struct ParticleEditSettings particle;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Transform Proportional Area of Effect. */
|
2009-09-19 00:25:49 +02:00
|
|
|
float proportional_size;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Select Group Threshold. */
|
2006-05-21 19:12:10 +02:00
|
|
|
float select_thresh;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Auto-Keying Mode. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Defines in DNA_userdef_types.h. */
|
|
|
|
short autokey_flag;
|
2018-12-18 00:03:50 +01:00
|
|
|
char autokey_mode;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Keyframe type (see DNA_curve_types.h). */
|
|
|
|
char keyframe_type;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-01-31 04:22:22 +01:00
|
|
|
/** Multi-resolution meshes. */
|
2007-03-21 07:33:04 +01:00
|
|
|
char multires_subdiv_type;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Edge tagging, store operator settings (no UI access). */
|
2008-05-08 18:33:55 +02:00
|
|
|
char edge_mode;
|
2019-05-21 03:13:45 +02:00
|
|
|
|
2011-03-10 06:52:16 +01:00
|
|
|
char edge_mode_live_unwrap;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Transform. */
|
|
|
|
|
2018-05-12 21:56:47 +02:00
|
|
|
char transform_pivot_point;
|
|
|
|
char transform_flag;
|
2022-09-16 10:13:19 +02:00
|
|
|
/** Snap elements (per space-type), #eSnapMode. */
|
2021-09-29 09:47:32 +02:00
|
|
|
char snap_node_mode;
|
2023-09-28 03:10:19 +02:00
|
|
|
short snap_mode;
|
|
|
|
short snap_uv_mode;
|
2023-09-05 10:06:55 +02:00
|
|
|
short snap_anim_mode;
|
2022-09-16 10:13:19 +02:00
|
|
|
/** Generic flags (per space-type), #eSnapFlag. */
|
Transform Snap: nearest face snap mode, snapping options, refactoring.
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.
The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).
The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.
The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.
The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.
Included in this patch:
- Snap target selection is more controllable for artist with additional
snapping options.
- Renamed a few of the snap-related functions to better reflect what
they actually do now. For example, `applySnapping` implies that this
handles the snapping, while `applyProject` implies something entirely
different is done there. However, better names would be
`applySnappingAsGroup` and `applySnappingIndividual`, respectively,
where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
the nearest target before transforming can be determined(for "Snap to
Same Object"), and so the transformation can be broken into smaller
steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
should be called "Project onto Active" instead, but that only matters
when editing multiple meshes at the same time. This patch makes this
change in the UI.
Reviewed By: Campbell Barton, Germano Cavalcante
Differential Revision: https://developer.blender.org/D14591
2022-06-30 02:52:00 +02:00
|
|
|
short snap_flag;
|
|
|
|
short snap_flag_node;
|
|
|
|
short snap_flag_seq;
|
2023-09-05 10:06:55 +02:00
|
|
|
short snap_flag_anim;
|
Transform Snap: nearest face snap mode, snapping options, refactoring.
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.
The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).
The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.
The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.
The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.
Included in this patch:
- Snap target selection is more controllable for artist with additional
snapping options.
- Renamed a few of the snap-related functions to better reflect what
they actually do now. For example, `applySnapping` implies that this
handles the snapping, while `applyProject` implies something entirely
different is done there. However, better names would be
`applySnappingAsGroup` and `applySnappingIndividual`, respectively,
where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
the nearest target before transforming can be determined(for "Snap to
Same Object"), and so the transformation can be broken into smaller
steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
should be called "Project onto Active" instead, but that only matters
when editing multiple meshes at the same time. This patch makes this
change in the UI.
Reviewed By: Campbell Barton, Germano Cavalcante
Differential Revision: https://developer.blender.org/D14591
2022-06-30 02:52:00 +02:00
|
|
|
short snap_uv_flag;
|
2023-09-05 10:06:55 +02:00
|
|
|
char _pad[4];
|
2023-01-12 14:16:25 +01:00
|
|
|
/** Default snap source, #eSnapSourceOP. */
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
|
|
|
* TODO(@gfxcoder): Rename `snap_target` to `snap_source` to avoid previous ambiguity of
|
Transform Snap: nearest face snap mode, snapping options, refactoring.
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.
The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).
The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.
The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.
The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.
Included in this patch:
- Snap target selection is more controllable for artist with additional
snapping options.
- Renamed a few of the snap-related functions to better reflect what
they actually do now. For example, `applySnapping` implies that this
handles the snapping, while `applyProject` implies something entirely
different is done there. However, better names would be
`applySnappingAsGroup` and `applySnappingIndividual`, respectively,
where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
the nearest target before transforming can be determined(for "Snap to
Same Object"), and so the transformation can be broken into smaller
steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
should be called "Project onto Active" instead, but that only matters
when editing multiple meshes at the same time. This patch makes this
change in the UI.
Reviewed By: Campbell Barton, Germano Cavalcante
Differential Revision: https://developer.blender.org/D14591
2022-06-30 02:52:00 +02:00
|
|
|
* "target" (now, "source" is geometry to be moved and "target" is geometry to which moved
|
2022-12-15 00:31:18 +01:00
|
|
|
* geometry is snapped).
|
|
|
|
*/
|
2018-05-12 21:56:47 +02:00
|
|
|
char snap_target;
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
/** Snap mask for transform modes, #eSnapTransformMode. */
|
2018-12-18 11:54:02 +01:00
|
|
|
char snap_transform_mode_flag;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Steps to break transformation into with face nearest snapping. */
|
Transform Snap: nearest face snap mode, snapping options, refactoring.
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.
The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).
The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.
The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.
The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.
Included in this patch:
- Snap target selection is more controllable for artist with additional
snapping options.
- Renamed a few of the snap-related functions to better reflect what
they actually do now. For example, `applySnapping` implies that this
handles the snapping, while `applyProject` implies something entirely
different is done there. However, better names would be
`applySnappingAsGroup` and `applySnappingIndividual`, respectively,
where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
the nearest target before transforming can be determined(for "Snap to
Same Object"), and so the transformation can be broken into smaller
steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
should be called "Project onto Active" instead, but that only matters
when editing multiple meshes at the same time. This patch makes this
change in the UI.
Reviewed By: Campbell Barton, Germano Cavalcante
Differential Revision: https://developer.blender.org/D14591
2022-06-30 02:52:00 +02:00
|
|
|
short snap_face_nearest_steps;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-30 05:42:18 +02:00
|
|
|
char proportional_edit, prop_mode;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Proportional edit, object mode. */
|
|
|
|
char proportional_objects;
|
|
|
|
/** Proportional edit, mask editing. */
|
|
|
|
char proportional_mask;
|
|
|
|
/** Proportional edit, action editor. */
|
|
|
|
char proportional_action;
|
|
|
|
/** Proportional edit, graph editor. */
|
|
|
|
char proportional_fcurve;
|
|
|
|
/** Lock marker editing. */
|
|
|
|
char lock_markers;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-02 10:25:13 +02:00
|
|
|
/** Auto normalizing mode in wpaint. */
|
2019-01-07 12:19:13 +01:00
|
|
|
char auto_normalize;
|
2018-10-07 17:25:51 +02:00
|
|
|
/** Present weights as if all locked vertex groups were
|
|
|
|
* deleted, and the remaining deform groups normalized. */
|
|
|
|
char wpaint_lock_relative;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Paint multiple bones in wpaint. */
|
|
|
|
char multipaint;
|
2013-02-22 05:09:04 +01:00
|
|
|
char weightuser;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Subset selection filter in wpaint. */
|
|
|
|
char vgroupsubset;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
/** Stroke selection mode for Vertex Paint. */
|
|
|
|
char gpencil_selectmode_vertex;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* UV painting. */
|
2018-04-20 10:18:25 +02:00
|
|
|
char uv_sculpt_settings;
|
|
|
|
char uv_relax_method;
|
2019-12-06 17:45:50 +01:00
|
|
|
|
|
|
|
char workspace_tool_type;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
|
|
|
* XXX: these `sculpt_paint_*` fields are deprecated, use the
|
|
|
|
* unified_paint_settings field instead!
|
|
|
|
*/
|
2022-03-10 22:33:04 +01:00
|
|
|
short sculpt_paint_settings DNA_DEPRECATED;
|
2012-01-12 18:22:32 +01:00
|
|
|
int sculpt_paint_unified_size DNA_DEPRECATED;
|
|
|
|
float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED;
|
|
|
|
float sculpt_paint_unified_alpha DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Unified Paint Settings. */
|
2012-01-12 18:22:32 +01:00
|
|
|
struct UnifiedPaintSettings unified_paint_settings;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-04-15 10:10:05 +02:00
|
|
|
struct CurvePaintSettings curve_paint_settings;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-04-17 11:27:23 +02:00
|
|
|
struct MeshStatVis statvis;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Normal Editing. */
|
2018-05-25 18:54:24 +02:00
|
|
|
float normal_vector[3];
|
2019-05-20 14:51:18 +02:00
|
|
|
char _pad6[4];
|
2019-11-20 22:12:32 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
|
|
|
* Custom Curve Profile for bevel tool:
|
2019-11-20 22:12:32 +01:00
|
|
|
* Temporary until there is a proper preset system that stores the profiles or maybe stores
|
2022-12-15 00:31:18 +01:00
|
|
|
* entire bevel configurations.
|
|
|
|
*/
|
2019-11-20 22:12:32 +01:00
|
|
|
struct CurveProfile *custom_bevel_profile_preset;
|
2020-12-16 20:34:26 +01:00
|
|
|
|
|
|
|
struct SequencerToolSettings *sequencer_tool_settings;
|
|
|
|
|
2023-06-23 21:58:16 +02:00
|
|
|
short snap_mode_tools; /* If SCE_SNAP_TO_NONE, use #ToolSettings::snap_mode. #eSnapMode. */
|
2023-05-16 15:00:45 +02:00
|
|
|
char plane_axis; /* X, Y or Z. */
|
|
|
|
char plane_depth; /* #eV3DPlaceDepth. */
|
|
|
|
char plane_orient; /* #eV3DPlaceOrient. */
|
|
|
|
char use_plane_axis_auto;
|
|
|
|
char _pad7[2];
|
|
|
|
|
2009-09-19 00:25:49 +02:00
|
|
|
} ToolSettings;
|
2008-03-21 02:10:32 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* Assorted Scene Data. */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Unit Settings
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Display/Editing unit options for each scene. */
|
2009-09-19 00:25:49 +02:00
|
|
|
typedef struct UnitSettings {
|
2022-12-15 00:31:18 +01:00
|
|
|
|
2021-07-27 08:02:22 +02:00
|
|
|
/** Maybe have other unit conversions? */
|
2019-01-07 12:19:13 +01:00
|
|
|
float scale_length;
|
|
|
|
/** Imperial, metric etc. */
|
|
|
|
char system;
|
|
|
|
/** Not implemented as a proper unit system yet. */
|
|
|
|
char system_rotation;
|
2010-11-18 15:10:09 +01:00
|
|
|
short flag;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-10-03 10:20:16 +02:00
|
|
|
char length_unit;
|
|
|
|
char mass_unit;
|
|
|
|
char time_unit;
|
2020-09-07 21:59:07 +02:00
|
|
|
char temperature_unit;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-09-07 21:59:07 +02:00
|
|
|
char _pad[4];
|
2009-09-19 00:25:49 +02:00
|
|
|
} UnitSettings;
|
2006-11-06 02:08:26 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Global/Common Physics Settings
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-10-01 00:10:14 +02:00
|
|
|
typedef struct PhysicsSettings {
|
|
|
|
float gravity[3];
|
2021-05-12 08:44:59 +02:00
|
|
|
int flag, quick_cache_step;
|
|
|
|
char _pad0[4];
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-10-01 00:10:14 +02:00
|
|
|
} PhysicsSettings;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/**
|
|
|
|
* Safe Area options used in Camera View & Sequencer.
|
2015-01-19 06:30:35 +01:00
|
|
|
*/
|
|
|
|
typedef struct DisplaySafeAreas {
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Each value represents the (x,y) margins as a multiplier.
|
|
|
|
* 'center' in this context is just the name for a different kind of safe-area. */
|
2015-01-19 06:30:35 +01:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Title Safe. */
|
|
|
|
float title[2];
|
|
|
|
/** Image/Graphics Safe. */
|
|
|
|
float action[2];
|
2015-01-19 06:30:35 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Use for alternate aspect ratio. */
|
2015-01-19 06:30:35 +01:00
|
|
|
float title_center[2];
|
|
|
|
float action_center[2];
|
|
|
|
} DisplaySafeAreas;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/**
|
|
|
|
* Scene Display - used for store scene specific display settings for the 3d view.
|
|
|
|
*/
|
2018-05-09 13:30:27 +02:00
|
|
|
typedef struct SceneDisplay {
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Light direction for shadows/highlight. */
|
|
|
|
float light_direction[3];
|
2018-11-30 13:26:30 +01:00
|
|
|
float shadow_shift, shadow_focus;
|
2018-05-16 21:28:05 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Settings for Cavity Shader. */
|
2018-05-16 21:28:05 +02:00
|
|
|
float matcap_ssao_distance;
|
|
|
|
float matcap_ssao_attenuation;
|
|
|
|
int matcap_ssao_samples;
|
2018-07-11 11:43:56 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Method of AA for viewport rendering and image rendering. */
|
2019-05-02 15:18:53 +02:00
|
|
|
char viewport_aa;
|
|
|
|
char render_aa;
|
|
|
|
char _pad[6];
|
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** OpenGL render engine settings. */
|
2018-07-11 11:43:56 +02:00
|
|
|
View3DShading shading;
|
2018-05-09 13:30:27 +02:00
|
|
|
} SceneDisplay;
|
|
|
|
|
2023-08-03 15:32:06 +02:00
|
|
|
/**
|
2023-08-05 05:46:22 +02:00
|
|
|
* Ray-tracing parameters.
|
2023-08-03 15:32:06 +02:00
|
|
|
*/
|
|
|
|
typedef struct RaytraceEEVEE {
|
|
|
|
/** Higher values will take lower strides and have less blurry intersections. */
|
|
|
|
float screen_trace_quality;
|
|
|
|
/** Thickness in world space each surface will have during screen space tracing. */
|
|
|
|
float screen_trace_thickness;
|
2023-11-21 16:24:14 +01:00
|
|
|
/** Maximum roughness before using horizon scan. */
|
|
|
|
float screen_trace_max_roughness;
|
2023-08-03 15:32:06 +02:00
|
|
|
/** Resolution downscale factor. */
|
|
|
|
int resolution_scale;
|
|
|
|
/** Maximum intensity a ray can have. */
|
|
|
|
float sample_clamp;
|
|
|
|
/** #RaytraceEEVEE_Flag. */
|
|
|
|
int flag;
|
|
|
|
/** #RaytraceEEVEE_DenoiseStages. */
|
|
|
|
int denoise_stages;
|
2023-11-21 16:24:14 +01:00
|
|
|
|
|
|
|
char _pad0[4];
|
2023-08-03 15:32:06 +02:00
|
|
|
} RaytraceEEVEE;
|
|
|
|
|
2018-05-16 19:34:24 +02:00
|
|
|
typedef struct SceneEEVEE {
|
|
|
|
int flag;
|
|
|
|
int gi_diffuse_bounces;
|
|
|
|
int gi_cubemap_resolution;
|
|
|
|
int gi_visibility_resolution;
|
2018-11-15 18:13:07 +01:00
|
|
|
float gi_irradiance_smoothing;
|
2018-11-15 19:41:15 +01:00
|
|
|
float gi_glossy_clamp;
|
2018-11-15 20:04:35 +01:00
|
|
|
float gi_filter_quality;
|
2023-08-06 20:30:08 +02:00
|
|
|
int gi_irradiance_pool_size;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-10 15:02:25 +02:00
|
|
|
float gi_cubemap_draw_size;
|
|
|
|
float gi_irradiance_draw_size;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-16 19:34:24 +02:00
|
|
|
int taa_samples;
|
|
|
|
int taa_render_samples;
|
|
|
|
int sss_samples;
|
|
|
|
float sss_jitter_threshold;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-16 19:34:24 +02:00
|
|
|
float ssr_quality;
|
|
|
|
float ssr_max_roughness;
|
|
|
|
float ssr_thickness;
|
|
|
|
float ssr_border_fade;
|
|
|
|
float ssr_firefly_fac;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-16 19:34:24 +02:00
|
|
|
float volumetric_start;
|
|
|
|
float volumetric_end;
|
|
|
|
int volumetric_tile_size;
|
|
|
|
int volumetric_samples;
|
|
|
|
float volumetric_sample_distribution;
|
|
|
|
float volumetric_light_clamp;
|
|
|
|
int volumetric_shadow_samples;
|
2023-10-19 19:22:14 +02:00
|
|
|
int volumetric_ray_depth;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-16 19:34:24 +02:00
|
|
|
float gtao_distance;
|
|
|
|
float gtao_factor;
|
|
|
|
float gtao_quality;
|
2023-11-02 19:22:01 +01:00
|
|
|
float gtao_thickness;
|
|
|
|
float gtao_focus;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-02-12 22:35:18 +01:00
|
|
|
float bokeh_overblur;
|
2018-05-16 19:34:24 +02:00
|
|
|
float bokeh_max_size;
|
|
|
|
float bokeh_threshold;
|
2021-02-12 22:35:18 +01:00
|
|
|
float bokeh_neighbor_max;
|
|
|
|
float bokeh_denoise_fac;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-16 19:34:24 +02:00
|
|
|
float bloom_color[3];
|
|
|
|
float bloom_threshold;
|
|
|
|
float bloom_knee;
|
|
|
|
float bloom_intensity;
|
|
|
|
float bloom_radius;
|
|
|
|
float bloom_clamp;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-06-19 17:02:55 +02:00
|
|
|
int motion_blur_samples DNA_DEPRECATED;
|
|
|
|
int motion_blur_max;
|
2020-06-23 13:59:55 +02:00
|
|
|
int motion_blur_steps;
|
2020-10-13 16:55:19 +02:00
|
|
|
int motion_blur_position;
|
2018-05-16 19:34:24 +02:00
|
|
|
float motion_blur_shutter;
|
2020-06-19 17:02:55 +02:00
|
|
|
float motion_blur_depth_scale;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-08-22 16:04:25 +02:00
|
|
|
int shadow_method DNA_DEPRECATED;
|
2018-05-16 19:34:24 +02:00
|
|
|
int shadow_cube_size;
|
|
|
|
int shadow_cascade_size;
|
2023-02-08 21:08:54 +01:00
|
|
|
int shadow_pool_size;
|
2023-09-26 23:42:40 +02:00
|
|
|
int shadow_ray_count;
|
|
|
|
int shadow_step_count;
|
|
|
|
float shadow_normal_bias;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-08-03 15:32:06 +02:00
|
|
|
int ray_split_settings;
|
|
|
|
int ray_tracing_method;
|
|
|
|
|
|
|
|
struct RaytraceEEVEE reflection_options;
|
|
|
|
struct RaytraceEEVEE refraction_options;
|
2023-09-26 23:45:40 +02:00
|
|
|
struct RaytraceEEVEE diffuse_options;
|
2023-08-03 15:32:06 +02:00
|
|
|
|
2020-03-11 17:12:01 +01:00
|
|
|
struct LightCache *light_cache DNA_DEPRECATED;
|
|
|
|
struct LightCache *light_cache_data;
|
2023-07-12 20:22:00 +02:00
|
|
|
/* Need a 128 byte string for some translations of some messages. */
|
|
|
|
char light_cache_info[128];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-10-31 18:31:14 +01:00
|
|
|
float overscan;
|
2018-11-15 14:44:45 +01:00
|
|
|
float light_threshold;
|
2018-05-16 19:34:24 +02:00
|
|
|
} SceneEEVEE;
|
|
|
|
|
2020-05-12 17:47:48 +02:00
|
|
|
typedef struct SceneGpencil {
|
|
|
|
float smaa_threshold;
|
|
|
|
char _pad[4];
|
|
|
|
} SceneGpencil;
|
|
|
|
|
2023-08-04 15:06:12 +02:00
|
|
|
typedef struct SceneHydra {
|
|
|
|
int export_method;
|
|
|
|
int _pad0;
|
|
|
|
} SceneHydra;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Transform Orientation
|
|
|
|
* \{ */
|
2012-01-11 00:14:20 +01:00
|
|
|
|
2018-12-19 10:51:04 +01:00
|
|
|
typedef struct TransformOrientationSlot {
|
|
|
|
int type;
|
|
|
|
int index_custom;
|
|
|
|
char flag;
|
|
|
|
char _pad0[7];
|
|
|
|
} TransformOrientationSlot;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** Indices when used in #Scene::orientation_slots. */
|
2018-12-19 10:51:04 +01:00
|
|
|
enum {
|
|
|
|
SCE_ORIENT_DEFAULT = 0,
|
|
|
|
SCE_ORIENT_TRANSLATE = 1,
|
|
|
|
SCE_ORIENT_ROTATE = 2,
|
|
|
|
SCE_ORIENT_SCALE = 3,
|
|
|
|
};
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Scene ID-Block
|
|
|
|
* \{ */
|
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct Scene {
|
|
|
|
ID id;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Animation data (must be immediately after id for utilities to use it). */
|
|
|
|
struct AnimData *adt;
|
2023-10-05 13:49:51 +02:00
|
|
|
/**
|
|
|
|
* Engines draw data, must be immediately after AnimData. See IdDdtTemplate and
|
|
|
|
* DRW_drawdatalist_from_id to understand this requirement.
|
|
|
|
*/
|
Attribute Node: support accessing attributes of View Layer and Scene.
The attribute node already allows accessing attributes associated
with objects and meshes, which allows changing the behavior of the
same material between different objects or instances. The same idea
can be extended to an even more global level of layers and scenes.
Currently view layers provide an option to replace all materials
with a different one. However, since the same material will be applied
to all objects in the layer, varying the behavior between layers while
preserving distinct materials requires duplicating objects.
Providing access to properties of layers and scenes via the attribute
node enables making materials with built-in switches or settings that
can be controlled globally at the view layer level. This is probably
most useful for complex NPR shading and compositing. Like with objects,
the node can also access built-in scene properties, like render resolution
or FOV of the active camera. Lookup is also attempted in World, similar
to how the Object mode checks the Mesh datablock.
In Cycles this mode is implemented by replacing the attribute node with
the attribute value during sync, allowing constant folding to take the
values into account. This means however that materials that use this
feature have to be re-synced upon any changes to scene, world or camera.
The Eevee version uses a new uniform buffer containing a sorted array
mapping name hashes to values, with binary search lookup. The array
is limited to 512 entries, which is effectively limitless even
considering it is shared by all materials in the scene; it is also
just 16KB of memory so no point trying to optimize further.
The buffer has to be rebuilt when new attributes are detected in a
material, so the draw engine keeps a table of recently seen attribute
names to minimize the chance of extra rebuilds mid-draw.
Differential Revision: https://developer.blender.org/D15941
2022-09-11 23:30:58 +02:00
|
|
|
DrawDataList drawdata;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
struct Object *camera;
|
|
|
|
struct World *world;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
struct Scene *set;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2017-11-08 15:16:49 +01:00
|
|
|
ListBase base DNA_DEPRECATED;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Active base. */
|
|
|
|
struct Base *basact DNA_DEPRECATED;
|
2018-02-13 22:39:10 +01:00
|
|
|
void *_pad1;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** 3d cursor location. */
|
|
|
|
View3DCursor cursor;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Bit-flags for layer visibility (deprecated). */
|
2019-01-07 12:19:13 +01:00
|
|
|
unsigned int lay DNA_DEPRECATED;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Active layer (deprecated). */
|
2019-01-07 12:19:13 +01:00
|
|
|
int layact DNA_DEPRECATED;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad2[4];
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Various settings. */
|
|
|
|
short flag;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2014-03-31 23:30:24 +02:00
|
|
|
char use_nodes;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad3[1];
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2012-10-21 07:46:41 +02:00
|
|
|
struct bNodeTree *nodetree;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Sequence editor data is allocated here. */
|
|
|
|
struct Editing *ed;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Default allocated now. */
|
|
|
|
struct ToolSettings *toolsettings;
|
2019-02-27 05:07:50 +01:00
|
|
|
void *_pad4;
|
2015-01-19 06:30:35 +01:00
|
|
|
struct DisplaySafeAreas safe_areas;
|
2005-08-24 22:37:25 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Migrate or replace? depends on some internal things... */
|
|
|
|
/* No, is on the right place (ton). */
|
2002-10-12 13:37:38 +02:00
|
|
|
struct RenderData r;
|
2009-09-20 16:00:00 +02:00
|
|
|
struct AudioData audio;
|
2017-06-01 20:41:18 +02:00
|
|
|
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 19:19:21 +02:00
|
|
|
ListBase markers;
|
2018-04-18 09:12:44 +02:00
|
|
|
ListBase transform_spaces;
|
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** First is the [scene, translate, rotate, scale]. */
|
2018-12-19 10:51:04 +01:00
|
|
|
TransformOrientationSlot orientation_slots[4];
|
2017-06-01 20:41:18 +02:00
|
|
|
|
2010-02-08 00:41:17 +01:00
|
|
|
void *sound_scene;
|
2015-05-15 16:51:17 +02:00
|
|
|
void *playback_handle;
|
2010-08-02 20:22:34 +02:00
|
|
|
void *sound_scrub_handle;
|
2011-08-03 11:25:40 +02:00
|
|
|
void *speaker_handles;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2023-01-16 03:57:10 +01:00
|
|
|
/** (runtime) info/cache used for presenting playback frame-rate info to the user. */
|
2019-01-07 12:19:13 +01:00
|
|
|
void *fps_info;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** None of the dependency graph vars is mean to be saved. */
|
2017-10-20 12:28:25 +02:00
|
|
|
struct GHash *depsgraph_hash;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad7[4];
|
2006-11-06 02:08:26 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* User-Defined KeyingSets. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/**
|
|
|
|
* Index of the active KeyingSet.
|
|
|
|
* first KeyingSet has index 1, 'none' active is 0, 'add new' is -1
|
|
|
|
*/
|
|
|
|
int active_keyingset;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** KeyingSets for this scene. */
|
2019-01-07 12:19:13 +01:00
|
|
|
ListBase keyingsets;
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Units. */
|
2009-09-19 00:25:49 +02:00
|
|
|
struct UnitSettings unit;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Grease Pencil - Annotations. */
|
2009-09-19 00:25:49 +02:00
|
|
|
struct bGPdata *gpd;
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-10-01 00:10:14 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Movie Tracking. */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Active movie clip. */
|
|
|
|
struct MovieClip *clip;
|
2011-12-23 21:30:23 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Physics simulation settings. */
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-10-01 00:10:14 +02:00
|
|
|
struct PhysicsSettings physics_settings;
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2019-02-27 05:07:50 +01:00
|
|
|
void *_pad8;
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
|
|
|
* XXX: runtime flag for drawing, actually belongs in the window,
|
|
|
|
* only used by #BKE_object_handle_update()
|
|
|
|
*/
|
Refactor CDData masks, to have one mask per mesh elem type.
We already have different storages for cddata of verts, edges etc.,
'simply' do the same for the mask flags we use all around Blender code
to request some data, or limit some operation to some layers, etc.
Reason we need this is that some cddata types (like Normals) are
actually shared between verts/polys/loops, and we don’t want to generate
clnors everytime we request vnors!
As a side note, this also does final fix to T59338, which was the
trigger for this patch (need to request computed loop normals for
another mesh than evaluated one).
Reviewers: brecht, campbellbarton, sergey
Differential Revision: https://developer.blender.org/D4407
2019-03-07 11:13:40 +01:00
|
|
|
struct CustomData_MeshMasks customdata_mask;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** XXX: same as above but for temp operator use (viewport renders). */
|
Refactor CDData masks, to have one mask per mesh elem type.
We already have different storages for cddata of verts, edges etc.,
'simply' do the same for the mask flags we use all around Blender code
to request some data, or limit some operation to some layers, etc.
Reason we need this is that some cddata types (like Normals) are
actually shared between verts/polys/loops, and we don’t want to generate
clnors everytime we request vnors!
As a side note, this also does final fix to T59338, which was the
trigger for this patch (need to request computed loop normals for
another mesh than evaluated one).
Reviewers: brecht, campbellbarton, sergey
Differential Revision: https://developer.blender.org/D4407
2019-03-07 11:13:40 +01:00
|
|
|
struct CustomData_MeshMasks customdata_mask_modal;
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Color Management. */
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
ColorManagedViewSettings view_settings;
|
|
|
|
ColorManagedDisplaySettings display_settings;
|
|
|
|
ColorManagedColorspaceSettings sequencer_colorspace_settings;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** RigidBody simulation world+settings. */
|
2013-01-23 06:56:22 +01:00
|
|
|
struct RigidBodyWorld *rigidbody_world;
|
2015-08-10 15:41:28 +02:00
|
|
|
|
|
|
|
struct PreviewImage *preview;
|
Render Layers and Collections (merge from render-layers)
Design Documents
----------------
* https://wiki.blender.org/index.php/Dev:2.8/Source/Layers
* https://wiki.blender.org/index.php/Dev:2.8/Source/DataDesignRevised
User Commit Log
---------------
* New Layer and Collection system to replace render layers and viewport layers.
* A layer is a set of collections of objects (and their drawing options) required for specific tasks.
* A collection is a set of objects, equivalent of the old layers in Blender. A collection can be shared across multiple layers.
* All Scenes have a master collection that all other collections are children of.
* New collection "context" tab (in Properties Editor)
* New temporary viewport "collections" panel to control per-collection
visibility
Missing User Features
---------------------
* Collection "Filter"
Option to add objects based on their names
* Collection Manager operators
The existing buttons are placeholders
* Collection Manager drawing
The editor main region is empty
* Collection Override
* Per-Collection engine settings
This will come as a separate commit, as part of the clay-engine branch
Dev Commit Log
--------------
* New DNA file (DNA_layer_types.h) with the new structs
We are replacing Base by a new extended Base while keeping it backward
compatible with some legacy settings (i.e., lay, flag_legacy).
Renamed all Base to BaseLegacy to make it clear the areas of code that
still need to be converted
Note: manual changes were required on - deg_builder_nodes.h, rna_object.c, KX_Light.cpp
* Unittesting for main syncronization requirements
- read, write, add/copy/remove objects, copy scene, collection
link/unlinking, context)
* New Editor: Collection Manager
Based on patch by Julian Eisel
This is extracted from the layer-manager branch. With the following changes:
- Renamed references of layer manager to collections manager
- I doesn't include the editors/space_collections/ draw and util files
- The drawing code itself will be implemented separately by Julian
* Base / Object:
A little note about them. Original Blender code would try to keep them
in sync through the code, juggling flags back and forth. This will now
be handled by Depsgraph, keeping Object and Bases more separated
throughout the non-rendering code.
Scene.base is being cleared in doversion, and the old viewport drawing
code was poorly converted to use the new bases while the new viewport
code doesn't get merged and replace the old one.
Python API Changes
------------------
```
- scene.layers
+ # no longer exists
- scene.objects
+ scene.scene_layers.active.objects
- scene.objects.active
+ scene.render_layers.active.objects.active
- bpy.context.scene.objects.link()
+ bpy.context.scene_collection.objects.link()
- bpy_extras.object_utils.object_data_add(context, obdata, operator=None, use_active_layer=True, name=None)
+ bpy_extras.object_utils.object_data_add(context, obdata, operator=None, name=None)
- bpy.context.object.select
+ bpy.context.object.select = True
+ bpy.context.object.select = False
+ bpy.context.object.select_get()
+ bpy.context.object.select_set(action='SELECT')
+ bpy.context.object.select_set(action='DESELECT')
-AddObjectHelper.layers
+ # no longer exists
```
2017-02-07 10:18:38 +01:00
|
|
|
|
2023-04-17 10:57:09 +02:00
|
|
|
/** ViewLayer, defined in DNA_layer_types.h */
|
2017-11-22 13:52:39 +01:00
|
|
|
ListBase view_layers;
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Not an actual data-block, but memory owned by scene. */
|
2020-12-15 00:47:58 +01:00
|
|
|
struct Collection *master_collection;
|
2017-02-07 11:20:15 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Settings to be override by work-spaces. */
|
2019-01-07 12:19:13 +01:00
|
|
|
IDProperty *layer_properties;
|
2018-05-09 13:30:27 +02:00
|
|
|
|
2023-09-26 20:30:46 +02:00
|
|
|
/**
|
|
|
|
* Frame range used for simulations in geometry nodes by default, if SCE_CUSTOM_SIMULATION_RANGE
|
|
|
|
* is set. Individual simulations can overwrite this though.
|
|
|
|
*/
|
|
|
|
int simulation_frame_start;
|
|
|
|
int simulation_frame_end;
|
|
|
|
|
2018-05-09 13:30:27 +02:00
|
|
|
struct SceneDisplay display;
|
2018-05-16 19:34:24 +02:00
|
|
|
struct SceneEEVEE eevee;
|
2020-05-12 17:47:48 +02:00
|
|
|
struct SceneGpencil grease_pencil_settings;
|
2023-08-04 15:06:12 +02:00
|
|
|
struct SceneHydra hydra;
|
2002-10-12 13:37:38 +02:00
|
|
|
} Scene;
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Render Data Enum/Flags
|
|
|
|
* \{ */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RenderData::flag. */
|
|
|
|
enum {
|
|
|
|
/** Use preview range. */
|
|
|
|
SCER_PRV_RANGE = 1 << 0,
|
|
|
|
SCER_LOCK_FRAME_SELECTION = 1 << 1,
|
|
|
|
/** Show/use sub-frames (for checking motion blur). */
|
|
|
|
SCER_SHOW_SUBFRAME = 1 << 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #RenderData::mode. */
|
|
|
|
enum {
|
|
|
|
R_MODE_UNUSED_0 = 1 << 0, /* dirty */
|
|
|
|
R_MODE_UNUSED_1 = 1 << 1, /* cleared */
|
|
|
|
R_MODE_UNUSED_2 = 1 << 2, /* cleared */
|
|
|
|
R_MODE_UNUSED_3 = 1 << 3, /* cleared */
|
|
|
|
R_MODE_UNUSED_4 = 1 << 4, /* cleared */
|
|
|
|
R_MODE_UNUSED_5 = 1 << 5, /* cleared */
|
|
|
|
R_MODE_UNUSED_6 = 1 << 6, /* cleared */
|
|
|
|
R_MODE_UNUSED_7 = 1 << 7, /* cleared */
|
|
|
|
R_MODE_UNUSED_8 = 1 << 8, /* cleared */
|
|
|
|
R_BORDER = 1 << 9,
|
|
|
|
R_MODE_UNUSED_10 = 1 << 10, /* cleared */
|
|
|
|
R_CROP = 1 << 11,
|
|
|
|
/** Disable camera switching: runtime (DURIAN_CAMERA_SWITCH) */
|
|
|
|
R_NO_CAMERA_SWITCH = 1 << 12,
|
|
|
|
R_MODE_UNUSED_13 = 1 << 13, /* cleared */
|
|
|
|
R_MBLUR = 1 << 14,
|
|
|
|
/* unified was here */
|
|
|
|
R_MODE_UNUSED_16 = 1 << 16, /* cleared */
|
|
|
|
R_MODE_UNUSED_17 = 1 << 17, /* cleared */
|
|
|
|
R_MODE_UNUSED_18 = 1 << 18, /* cleared */
|
|
|
|
R_MODE_UNUSED_19 = 1 << 19, /* cleared */
|
|
|
|
R_FIXED_THREADS = 1 << 19,
|
|
|
|
|
|
|
|
R_MODE_UNUSED_20 = 1 << 20, /* cleared */
|
|
|
|
R_MODE_UNUSED_21 = 1 << 21, /* cleared */
|
|
|
|
R_NO_OVERWRITE = 1 << 22, /* Skip existing files. */
|
|
|
|
R_TOUCH = 1 << 23, /* Touch files before rendering. */
|
|
|
|
R_SIMPLIFY = 1 << 24,
|
|
|
|
R_EDGE_FRS = 1 << 25, /* R_EDGE reserved for Freestyle */
|
|
|
|
R_PERSISTENT_DATA = 1 << 26, /* Keep data around for re-render. */
|
|
|
|
R_MODE_UNUSED_27 = 1 << 27, /* cleared */
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #RenderData::seq_flag */
|
2017-11-24 12:19:26 +01:00
|
|
|
enum {
|
2019-03-17 00:28:08 +01:00
|
|
|
R_SEQ_UNUSED_0 = (1 << 0), /* cleared */
|
|
|
|
R_SEQ_UNUSED_1 = (1 << 1), /* cleared */
|
|
|
|
R_SEQ_UNUSED_2 = (1 << 2), /* cleared */
|
2019-04-25 16:24:06 +02:00
|
|
|
R_SEQ_UNUSED_3 = (1 << 3), /* cleared */
|
|
|
|
R_SEQ_UNUSED_4 = (1 << 4), /* cleared */
|
|
|
|
R_SEQ_OVERRIDE_SCENE_SETTINGS = (1 << 5),
|
2017-11-24 12:19:26 +01:00
|
|
|
};
|
2010-03-16 18:37:34 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RenderData::filtertype (used for nodes) */
|
|
|
|
enum {
|
|
|
|
R_FILTER_BOX = 0,
|
|
|
|
R_FILTER_TENT = 1,
|
|
|
|
R_FILTER_QUAD = 2,
|
|
|
|
R_FILTER_CUBIC = 3,
|
|
|
|
R_FILTER_CATROM = 4,
|
|
|
|
R_FILTER_GAUSS = 5,
|
|
|
|
R_FILTER_MITCH = 6,
|
|
|
|
R_FILTER_FAST_GAUSS = 7,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #RenderData::scemode */
|
|
|
|
enum {
|
|
|
|
R_DOSEQ = 1 << 0,
|
|
|
|
R_BG_RENDER = 1 << 1,
|
|
|
|
/* Passepartout is camera option now, keep this for backward compatibility. */
|
|
|
|
R_PASSEPARTOUT = 1 << 2,
|
|
|
|
R_BUTS_PREVIEW = 1 << 3,
|
|
|
|
R_EXTENSION = 1 << 4,
|
|
|
|
R_MATNODE_PREVIEW = 1 << 5,
|
|
|
|
R_DOCOMP = 1 << 6,
|
|
|
|
R_COMP_CROP = 1 << 7,
|
|
|
|
R_SCEMODE_UNUSED_8 = 1 << 8, /* cleared */
|
|
|
|
R_SINGLE_LAYER = 1 << 9,
|
|
|
|
R_SCEMODE_UNUSED_10 = 1 << 10, /* cleared */
|
|
|
|
R_SCEMODE_UNUSED_11 = 1 << 11, /* cleared */
|
|
|
|
R_NO_IMAGE_LOAD = 1 << 12,
|
|
|
|
R_SCEMODE_UNUSED_13 = 1 << 13, /* cleared */
|
|
|
|
R_NO_FRAME_UPDATE = 1 << 14,
|
|
|
|
R_SCEMODE_UNUSED_15 = 1 << 15, /* cleared */
|
|
|
|
R_SCEMODE_UNUSED_16 = 1 << 16, /* cleared */
|
|
|
|
R_SCEMODE_UNUSED_17 = 1 << 17, /* cleared */
|
|
|
|
R_TEXNODE_PREVIEW = 1 << 18,
|
|
|
|
R_SCEMODE_UNUSED_19 = 1 << 19, /* cleared */
|
|
|
|
R_EXR_CACHE_FILE = 1 << 20,
|
|
|
|
R_MULTIVIEW = 1 << 21,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #RenderData::stamp */
|
|
|
|
enum {
|
|
|
|
R_STAMP_TIME = 1 << 0,
|
|
|
|
R_STAMP_FRAME = 1 << 1,
|
|
|
|
R_STAMP_DATE = 1 << 2,
|
|
|
|
R_STAMP_CAMERA = 1 << 3,
|
|
|
|
R_STAMP_SCENE = 1 << 4,
|
|
|
|
R_STAMP_NOTE = 1 << 5,
|
|
|
|
/** Draw in the image space. */
|
|
|
|
R_STAMP_DRAW = 1 << 6,
|
|
|
|
R_STAMP_MARKER = 1 << 7,
|
|
|
|
R_STAMP_FILENAME = 1 << 8,
|
|
|
|
R_STAMP_SEQSTRIP = 1 << 9,
|
|
|
|
R_STAMP_RENDERTIME = 1 << 10,
|
|
|
|
R_STAMP_CAMERALENS = 1 << 11,
|
|
|
|
R_STAMP_STRIPMETA = 1 << 12,
|
|
|
|
R_STAMP_MEMORY = 1 << 13,
|
|
|
|
R_STAMP_HIDE_LABELS = 1 << 14,
|
|
|
|
R_STAMP_FRAME_RANGE = 1 << 15,
|
|
|
|
R_STAMP_HOSTNAME = 1 << 16,
|
|
|
|
};
|
|
|
|
|
2011-12-30 08:25:49 +01:00
|
|
|
#define R_STAMP_ALL \
|
|
|
|
(R_STAMP_TIME | R_STAMP_FRAME | R_STAMP_DATE | R_STAMP_CAMERA | R_STAMP_SCENE | R_STAMP_NOTE | \
|
|
|
|
R_STAMP_MARKER | R_STAMP_FILENAME | R_STAMP_SEQSTRIP | R_STAMP_RENDERTIME | \
|
2018-12-07 17:28:38 +01:00
|
|
|
R_STAMP_CAMERALENS | R_STAMP_MEMORY | R_STAMP_HIDE_LABELS | R_STAMP_FRAME_RANGE | \
|
|
|
|
R_STAMP_HOSTNAME)
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RenderData::alphamode */
|
2019-05-03 04:03:06 +02:00
|
|
|
enum {
|
|
|
|
R_ADDSKY = 0,
|
|
|
|
R_ALPHAPREMUL = 1,
|
|
|
|
};
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RenderData::color_mgt_flag */
|
2013-12-10 02:59:04 +01:00
|
|
|
enum {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Deprecated, should only be used in versioning code only. */
|
2019-01-15 13:14:35 +01:00
|
|
|
R_COLOR_MANAGEMENT = (1 << 0),
|
2019-03-17 00:28:08 +01:00
|
|
|
R_COLOR_MANAGEMENT_UNUSED_1 = (1 << 1),
|
2013-12-10 02:59:04 +01:00
|
|
|
};
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* bake_mode: same as RE_BAKE_xxx defines. */
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RenderData::bake_flag */
|
|
|
|
enum {
|
|
|
|
R_BAKE_CLEAR = 1 << 0,
|
|
|
|
// R_BAKE_OSA = 1 << 1, /* Deprecated. */
|
|
|
|
R_BAKE_TO_ACTIVE = 1 << 2,
|
|
|
|
// R_BAKE_NORMALIZE = 1 << 3, /* Deprecated. */
|
|
|
|
R_BAKE_MULTIRES = 1 << 4,
|
|
|
|
R_BAKE_LORES_MESH = 1 << 5,
|
|
|
|
// R_BAKE_VCOL = 1 << 6, /* Deprecated. */
|
|
|
|
R_BAKE_USERSCALE = 1 << 7,
|
|
|
|
R_BAKE_CAGE = 1 << 8,
|
|
|
|
R_BAKE_SPLIT_MAT = 1 << 9,
|
|
|
|
R_BAKE_AUTO_NAME = 1 << 10,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #RenderData::bake_normal_space */
|
|
|
|
enum {
|
|
|
|
R_BAKE_SPACE_CAMERA = 0,
|
|
|
|
R_BAKE_SPACE_WORLD = 1,
|
|
|
|
R_BAKE_SPACE_OBJECT = 2,
|
|
|
|
R_BAKE_SPACE_TANGENT = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #RenderData::line_thickness_mode */
|
|
|
|
enum {
|
|
|
|
R_LINE_THICKNESS_ABSOLUTE = 1,
|
|
|
|
R_LINE_THICKNESS_RELATIVE = 2,
|
|
|
|
};
|
2012-04-11 01:53:46 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Sequencer seq_prev_type seq_rend_type. */
|
2010-03-16 18:37:34 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RenderData::engine (scene.cc) */
|
2017-05-10 15:58:18 +02:00
|
|
|
extern const char *RE_engine_id_BLENDER_EEVEE;
|
2023-10-05 16:02:49 +02:00
|
|
|
extern const char *RE_engine_id_BLENDER_EEVEE_NEXT;
|
2018-11-26 19:00:01 +01:00
|
|
|
extern const char *RE_engine_id_BLENDER_WORKBENCH;
|
2014-10-28 12:49:04 +01:00
|
|
|
extern const char *RE_engine_id_CYCLES;
|
Patch #27397: Improved DPX/Cineon code
Patch by Julien Enche, thanks!
From the patch comment:
It allows Blender to load:
- 1, 8, 10, 12 and 16 bits files. For 10 and 12 bits files, packed or
filled type A/B are supported.
- RGB, Log, Luma and YCbCr colorspaces.
- Big and little endian storage.
- Multi-elements (planar) storage.
It allows Blender to save :
- 8, 10, 12 and 16 bits file. For 10 and 12 bits files, the most used
type A padding is used.
- RGB and Log colorspaces (Cineon can only be saved in Log colorspace).
For Log colorspace, the common default values are used for gamma,
reference black and reference white (respectively 1.7, 95 and 685 for
10 bits files).
- Saved DPX/Cineon files now match the viewer.
Some files won't load (mostly because I haven't seen any of them):
- Compressed files
- 32 and 64 bits files
- Image orientation information are not taken in account. Here too,
I haven't seen any file that was not top-bottom/left-right oriented.
2012-10-22 14:49:00 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Scene Defines
|
|
|
|
* \{ */
|
|
|
|
|
2023-02-12 04:37:16 +01:00
|
|
|
/* Note that much higher max-frames give imprecise sub-frames, see: #46859. */
|
2017-08-31 16:06:08 +02:00
|
|
|
/* Current precision is 16 for the sub-frames closer to MAXFRAME. */
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* For general use. */
|
2017-08-31 16:06:08 +02:00
|
|
|
#define MAXFRAME 1048574
|
|
|
|
#define MAXFRAMEF 1048574.0f
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2010-02-18 01:29:08 +01:00
|
|
|
#define MINFRAME 0
|
|
|
|
#define MINFRAMEF 0.0f
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** (Minimum frame number for current-frame). */
|
2017-08-31 16:06:08 +02:00
|
|
|
#define MINAFRAME -1048574
|
|
|
|
#define MINAFRAMEF -1048574.0f
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Scene Related Macros
|
|
|
|
* \{ */
|
|
|
|
|
2019-10-04 00:22:36 +02:00
|
|
|
#define BASE_VISIBLE(v3d, base) BKE_base_is_visible(v3d, base)
|
2019-01-03 14:20:43 +01:00
|
|
|
#define BASE_SELECTABLE(v3d, base) \
|
|
|
|
(BASE_VISIBLE(v3d, base) && \
|
|
|
|
((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_select) == 0)) && \
|
|
|
|
(((base)->flag & BASE_SELECTABLE) != 0))
|
|
|
|
#define BASE_SELECTED(v3d, base) (BASE_VISIBLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0))
|
2022-02-22 17:20:18 +01:00
|
|
|
#define BASE_EDITABLE(v3d, base) \
|
|
|
|
(BASE_VISIBLE(v3d, base) && !ID_IS_LINKED((base)->object) && \
|
|
|
|
(!ID_IS_OVERRIDE_LIBRARY_REAL((base)->object) || \
|
2023-05-02 16:13:02 +02:00
|
|
|
((base)->object->id.override_library->flag & LIBOVERRIDE_FLAG_SYSTEM_DEFINED) == 0))
|
2019-01-08 18:19:12 +01:00
|
|
|
#define BASE_SELECTED_EDITABLE(v3d, base) \
|
|
|
|
(BASE_EDITABLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0))
|
2017-02-07 19:11:17 +01:00
|
|
|
|
2019-01-08 18:19:12 +01:00
|
|
|
/* deprecate this! */
|
2018-04-06 18:17:18 +02:00
|
|
|
#define OBEDIT_FROM_OBACT(ob) ((ob) ? (((ob)->mode & OB_MODE_EDIT) ? ob : NULL) : NULL)
|
2018-05-11 08:16:41 +02:00
|
|
|
#define OBPOSE_FROM_OBACT(ob) ((ob) ? (((ob)->mode & OB_MODE_POSE) ? ob : NULL) : NULL)
|
2019-09-03 10:01:54 +02:00
|
|
|
#define OBWEIGHTPAINT_FROM_OBACT(ob) \
|
|
|
|
((ob) ? (((ob)->mode & OB_MODE_WEIGHT_PAINT) ? ob : NULL) : NULL)
|
2018-02-13 10:35:29 +01:00
|
|
|
|
2011-04-30 05:36:59 +02:00
|
|
|
#define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL)
|
|
|
|
#define V3D_CAMERA_SCENE(scene, v3d) \
|
|
|
|
((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-09 06:15:21 +01:00
|
|
|
#define PRVRANGEON (scene->r.flag & SCER_PRV_RANGE)
|
|
|
|
#define PSFRA ((PRVRANGEON) ? (scene->r.psfra) : (scene->r.sfra))
|
|
|
|
#define PEFRA ((PRVRANGEON) ? (scene->r.pefra) : (scene->r.efra))
|
|
|
|
#define FRA2TIME(a) ((((double)scene->r.frs_sec_base) * (double)(a)) / (double)scene->r.frs_sec)
|
|
|
|
#define TIME2FRA(a) ((((double)scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base)
|
|
|
|
#define FPS (((double)scene->r.frs_sec) / (double)scene->r.frs_sec_base)
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Scene Enum/Flags
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
/* Base.flag is in `DNA_object_types.h`. */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::transform_flag */
|
2018-05-12 21:56:47 +02:00
|
|
|
enum {
|
|
|
|
SCE_XFORM_AXIS_ALIGN = (1 << 0),
|
2019-08-22 05:45:31 +02:00
|
|
|
SCE_XFORM_DATA_ORIGIN = (1 << 1),
|
2019-08-28 17:45:36 +02:00
|
|
|
SCE_XFORM_SKIP_CHILDREN = (1 << 2),
|
2018-05-12 21:56:47 +02:00
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::object_flag */
|
2018-06-18 20:40:41 +02:00
|
|
|
enum {
|
|
|
|
SCE_OBJECT_MODE_LOCK = (1 << 0),
|
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::workspace_tool_flag */
|
2019-12-06 17:45:50 +01:00
|
|
|
enum {
|
|
|
|
SCE_WORKSPACE_TOOL_FALLBACK = 0,
|
|
|
|
SCE_WORKSPACE_TOOL_DEFAULT = 1,
|
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::snap_flag */
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
typedef enum eSnapFlag {
|
|
|
|
SCE_SNAP = (1 << 0),
|
|
|
|
SCE_SNAP_ROTATE = (1 << 1),
|
|
|
|
SCE_SNAP_PEEL_OBJECT = (1 << 2),
|
2023-06-23 21:58:16 +02:00
|
|
|
// SCE_SNAP_PROJECT = (1 << 3), /* DEPRECATED, see #SCE_SNAP_INDIVIDUAL_PROJECT. */
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Was `SCE_SNAP_NO_SELF`, but self should be active. */
|
|
|
|
SCE_SNAP_NOT_TO_ACTIVE = (1 << 4),
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
SCE_SNAP_ABS_GRID = (1 << 5),
|
2023-09-05 10:06:55 +02:00
|
|
|
/* Same value with different name to make it easier to understand in time based code. */
|
|
|
|
SCE_SNAP_ABS_TIME_STEP = (1 << 5),
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
SCE_SNAP_BACKFACE_CULLING = (1 << 6),
|
Transform Snap: nearest face snap mode, snapping options, refactoring.
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.
The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).
The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.
The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.
The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.
Included in this patch:
- Snap target selection is more controllable for artist with additional
snapping options.
- Renamed a few of the snap-related functions to better reflect what
they actually do now. For example, `applySnapping` implies that this
handles the snapping, while `applyProject` implies something entirely
different is done there. However, better names would be
`applySnappingAsGroup` and `applySnappingIndividual`, respectively,
where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
the nearest target before transforming can be determined(for "Snap to
Same Object"), and so the transformation can be broken into smaller
steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
should be called "Project onto Active" instead, but that only matters
when editing multiple meshes at the same time. This patch makes this
change in the UI.
Reviewed By: Campbell Barton, Germano Cavalcante
Differential Revision: https://developer.blender.org/D14591
2022-06-30 02:52:00 +02:00
|
|
|
SCE_SNAP_KEEP_ON_SAME_OBJECT = (1 << 7),
|
2023-01-12 14:16:25 +01:00
|
|
|
/** see #eSnapTargetOP */
|
Transform Snap: nearest face snap mode, snapping options, refactoring.
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.
The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).
The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.
The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.
The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.
Included in this patch:
- Snap target selection is more controllable for artist with additional
snapping options.
- Renamed a few of the snap-related functions to better reflect what
they actually do now. For example, `applySnapping` implies that this
handles the snapping, while `applyProject` implies something entirely
different is done there. However, better names would be
`applySnappingAsGroup` and `applySnappingIndividual`, respectively,
where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
the nearest target before transforming can be determined(for "Snap to
Same Object"), and so the transformation can be broken into smaller
steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
should be called "Project onto Active" instead, but that only matters
when editing multiple meshes at the same time. This patch makes this
change in the UI.
Reviewed By: Campbell Barton, Germano Cavalcante
Differential Revision: https://developer.blender.org/D14591
2022-06-30 02:52:00 +02:00
|
|
|
SCE_SNAP_TO_INCLUDE_EDITED = (1 << 8),
|
|
|
|
SCE_SNAP_TO_INCLUDE_NONEDITED = (1 << 9),
|
|
|
|
SCE_SNAP_TO_ONLY_SELECTABLE = (1 << 10),
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
} eSnapFlag;
|
2023-07-21 23:50:37 +02:00
|
|
|
|
|
|
|
ENUM_OPERATORS(eSnapFlag, SCE_SNAP_TO_ONLY_SELECTABLE)
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** See #ToolSettings::snap_target (to be renamed `snap_source`) and #TransSnap.source_operation */
|
2023-01-12 14:16:25 +01:00
|
|
|
typedef enum eSnapSourceOP {
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
SCE_SNAP_SOURCE_CLOSEST = 0,
|
|
|
|
SCE_SNAP_SOURCE_CENTER = 1,
|
|
|
|
SCE_SNAP_SOURCE_MEDIAN = 2,
|
|
|
|
SCE_SNAP_SOURCE_ACTIVE = 3,
|
2023-01-12 14:16:25 +01:00
|
|
|
} eSnapSourceOP;
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
|
2023-01-12 14:16:25 +01:00
|
|
|
ENUM_OPERATORS(eSnapSourceOP, SCE_SNAP_SOURCE_ACTIVE)
|
2022-11-17 17:13:38 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/**
|
2023-06-26 04:09:49 +02:00
|
|
|
* #TransSnap::target_operation and #ToolSettings::snap_flag
|
2022-12-15 00:31:18 +01:00
|
|
|
* (#SCE_SNAP_NOT_TO_ACTIVE, #SCE_SNAP_TO_INCLUDE_EDITED, #SCE_SNAP_TO_INCLUDE_NONEDITED,
|
|
|
|
* #SCE_SNAP_TO_ONLY_SELECTABLE).
|
|
|
|
*/
|
2023-01-12 14:16:25 +01:00
|
|
|
typedef enum eSnapTargetOP {
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
SCE_SNAP_TARGET_ALL = 0,
|
Transform Snap: nearest face snap mode, snapping options, refactoring.
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.
The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).
The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.
The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.
The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.
Included in this patch:
- Snap target selection is more controllable for artist with additional
snapping options.
- Renamed a few of the snap-related functions to better reflect what
they actually do now. For example, `applySnapping` implies that this
handles the snapping, while `applyProject` implies something entirely
different is done there. However, better names would be
`applySnappingAsGroup` and `applySnappingIndividual`, respectively,
where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
the nearest target before transforming can be determined(for "Snap to
Same Object"), and so the transformation can be broken into smaller
steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
should be called "Project onto Active" instead, but that only matters
when editing multiple meshes at the same time. This patch makes this
change in the UI.
Reviewed By: Campbell Barton, Germano Cavalcante
Differential Revision: https://developer.blender.org/D14591
2022-06-30 02:52:00 +02:00
|
|
|
SCE_SNAP_TARGET_NOT_SELECTED = (1 << 0),
|
|
|
|
SCE_SNAP_TARGET_NOT_ACTIVE = (1 << 1),
|
|
|
|
SCE_SNAP_TARGET_NOT_EDITED = (1 << 2),
|
|
|
|
SCE_SNAP_TARGET_ONLY_SELECTABLE = (1 << 3),
|
|
|
|
SCE_SNAP_TARGET_NOT_NONEDITED = (1 << 4),
|
2023-01-12 14:16:25 +01:00
|
|
|
} eSnapTargetOP;
|
|
|
|
ENUM_OPERATORS(eSnapTargetOP, SCE_SNAP_TARGET_NOT_NONEDITED)
|
2018-05-22 13:58:56 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::snap_mode */
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
typedef enum eSnapMode {
|
2023-06-23 21:58:16 +02:00
|
|
|
SCE_SNAP_TO_NONE = 0,
|
Transform Snap: nearest face snap mode, snapping options, refactoring.
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.
The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).
The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.
The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.
The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.
Included in this patch:
- Snap target selection is more controllable for artist with additional
snapping options.
- Renamed a few of the snap-related functions to better reflect what
they actually do now. For example, `applySnapping` implies that this
handles the snapping, while `applyProject` implies something entirely
different is done there. However, better names would be
`applySnappingAsGroup` and `applySnappingIndividual`, respectively,
where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
the nearest target before transforming can be determined(for "Snap to
Same Object"), and so the transformation can be broken into smaller
steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
should be called "Project onto Active" instead, but that only matters
when editing multiple meshes at the same time. This patch makes this
change in the UI.
Reviewed By: Campbell Barton, Germano Cavalcante
Differential Revision: https://developer.blender.org/D14591
2022-06-30 02:52:00 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::snap_node_mode */
|
2023-06-23 21:58:16 +02:00
|
|
|
SCE_SNAP_TO_NODE_X = (1 << 0),
|
|
|
|
SCE_SNAP_TO_NODE_Y = (1 << 1),
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
|
2023-09-27 21:25:55 +02:00
|
|
|
/** #ToolSettings::snap_anim_mode */
|
|
|
|
SCE_SNAP_TO_FRAME = (1 << 0),
|
|
|
|
SCE_SNAP_TO_SECOND = (1 << 1),
|
|
|
|
SCE_SNAP_TO_MARKERS = (1 << 2),
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::snap_mode and #ToolSettings::snap_node_mode and #ToolSettings.snap_uv_mode */
|
2023-06-23 20:36:57 +02:00
|
|
|
SCE_SNAP_TO_POINT = (1 << 0),
|
2023-09-27 21:25:55 +02:00
|
|
|
SCE_SNAP_TO_EDGE_MIDPOINT = (1 << 1),
|
|
|
|
SCE_SNAP_TO_EDGE_ENDPOINT = (1 << 2),
|
|
|
|
SCE_SNAP_TO_EDGE_PERPENDICULAR = (1 << 3),
|
|
|
|
SCE_SNAP_TO_EDGE = (1 << 4),
|
|
|
|
SCE_SNAP_TO_FACE = (1 << 5),
|
|
|
|
SCE_SNAP_TO_VOLUME = (1 << 6),
|
2023-06-23 21:58:16 +02:00
|
|
|
SCE_SNAP_TO_GRID = (1 << 7),
|
2023-09-27 21:25:55 +02:00
|
|
|
SCE_SNAP_TO_INCREMENT = (1 << 8),
|
2023-06-23 21:58:16 +02:00
|
|
|
|
|
|
|
/** For snap individual elements. */
|
2023-09-27 21:25:55 +02:00
|
|
|
SCE_SNAP_INDIVIDUAL_NEAREST = (1 << 9),
|
|
|
|
SCE_SNAP_INDIVIDUAL_PROJECT = (1 << 10),
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
} eSnapMode;
|
2023-09-05 10:06:55 +02:00
|
|
|
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
/* Due to dependency conflicts with Cycles, header cannot directly include `BLI_utildefines.h`. */
|
|
|
|
/* TODO: move this macro to a more general place. */
|
|
|
|
#ifdef ENUM_OPERATORS
|
2023-09-27 21:25:55 +02:00
|
|
|
ENUM_OPERATORS(eSnapMode, SCE_SNAP_INDIVIDUAL_PROJECT)
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
#endif
|
2021-06-29 20:12:19 +02:00
|
|
|
|
2023-06-23 20:36:57 +02:00
|
|
|
#define SCE_SNAP_TO_VERTEX (SCE_SNAP_TO_POINT | SCE_SNAP_TO_EDGE_ENDPOINT)
|
|
|
|
|
2023-06-23 21:58:16 +02:00
|
|
|
#define SCE_SNAP_TO_GEOM \
|
2023-09-27 21:25:55 +02:00
|
|
|
(SCE_SNAP_TO_VERTEX | SCE_SNAP_TO_EDGE | SCE_SNAP_TO_FACE | SCE_SNAP_TO_EDGE_MIDPOINT | \
|
|
|
|
SCE_SNAP_TO_EDGE_PERPENDICULAR)
|
2023-03-13 19:27:14 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #SequencerToolSettings::snap_mode */
|
|
|
|
enum {
|
|
|
|
SEQ_SNAP_TO_STRIPS = 1 << 0,
|
|
|
|
SEQ_SNAP_TO_CURRENT_FRAME = 1 << 1,
|
|
|
|
SEQ_SNAP_TO_STRIP_HOLD = 1 << 2,
|
|
|
|
};
|
2021-06-29 20:12:19 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #SequencerToolSettings::snap_flag */
|
|
|
|
enum {
|
|
|
|
SEQ_SNAP_IGNORE_MUTED = 1 << 0,
|
|
|
|
SEQ_SNAP_IGNORE_SOUND = 1 << 1,
|
|
|
|
SEQ_SNAP_CURRENT_FRAME_TO_STRIPS = 1 << 2,
|
|
|
|
};
|
2018-05-22 13:58:56 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::snap_transform_mode_flag */
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
typedef enum eSnapTransformMode {
|
2018-12-18 11:54:02 +01:00
|
|
|
SCE_SNAP_TRANSFORM_MODE_TRANSLATE = (1 << 0),
|
|
|
|
SCE_SNAP_TRANSFORM_MODE_ROTATE = (1 << 1),
|
|
|
|
SCE_SNAP_TRANSFORM_MODE_SCALE = (1 << 2),
|
Refactor: Snap-related. Clarified attribute names and refactored #defines into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
2022-06-06 16:28:14 +02:00
|
|
|
} eSnapTransformMode;
|
2018-12-18 00:03:50 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::selectmode */
|
|
|
|
enum {
|
|
|
|
SCE_SELECT_VERTEX = 1 << 0, /* for mesh */
|
|
|
|
SCE_SELECT_EDGE = 1 << 1,
|
|
|
|
SCE_SELECT_FACE = 1 << 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #MeshStatVis::type */
|
|
|
|
enum {
|
|
|
|
SCE_STATVIS_OVERHANG = 0,
|
|
|
|
SCE_STATVIS_THICKNESS = 1,
|
|
|
|
SCE_STATVIS_INTERSECT = 2,
|
|
|
|
SCE_STATVIS_DISTORT = 3,
|
|
|
|
SCE_STATVIS_SHARP = 4,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ParticleEditSettings::selectmode for particles */
|
|
|
|
enum {
|
|
|
|
SCE_SELECT_PATH = 1 << 0,
|
|
|
|
SCE_SELECT_POINT = 1 << 1,
|
|
|
|
SCE_SELECT_END = 1 << 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ToolSettings::prop_mode (proportional falloff) */
|
|
|
|
enum {
|
|
|
|
PROP_SMOOTH = 0,
|
|
|
|
PROP_SPHERE = 1,
|
|
|
|
PROP_ROOT = 2,
|
|
|
|
PROP_SHARP = 3,
|
|
|
|
PROP_LIN = 4,
|
|
|
|
PROP_CONST = 5,
|
|
|
|
PROP_RANDOM = 6,
|
|
|
|
PROP_INVSQUARE = 7,
|
|
|
|
PROP_MODE_MAX = 8,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ToolSettings::proportional_edit & similarly named members. */
|
2019-04-30 05:42:18 +02:00
|
|
|
enum {
|
|
|
|
PROP_EDIT_USE = (1 << 0),
|
|
|
|
PROP_EDIT_CONNECTED = (1 << 1),
|
|
|
|
PROP_EDIT_PROJECTED = (1 << 2),
|
|
|
|
};
|
2009-10-13 17:30:19 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::weightuser */
|
2013-02-22 05:09:04 +01:00
|
|
|
enum {
|
|
|
|
OB_DRAW_GROUPUSER_NONE = 0,
|
|
|
|
OB_DRAW_GROUPUSER_ACTIVE = 1,
|
2019-01-15 13:57:49 +01:00
|
|
|
OB_DRAW_GROUPUSER_ALL = 2,
|
2013-02-22 05:09:04 +01:00
|
|
|
};
|
|
|
|
|
2022-08-14 20:32:54 +02:00
|
|
|
/* object_vgroup.cc */
|
2022-04-04 05:17:03 +02:00
|
|
|
|
2013-06-23 17:37:08 +02:00
|
|
|
#define WT_VGROUP_MASK_ALL \
|
|
|
|
((1 << WT_VGROUP_ACTIVE) | (1 << WT_VGROUP_BONE_SELECT) | (1 << WT_VGROUP_BONE_DEFORM) | \
|
|
|
|
(1 << WT_VGROUP_BONE_DEFORM_OFF) | (1 << WT_VGROUP_ALL))
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #Scene::flag */
|
|
|
|
enum {
|
|
|
|
SCE_DS_SELECTED = 1 << 0,
|
|
|
|
SCE_DS_COLLAPSED = 1 << 1,
|
|
|
|
SCE_NLA_EDIT_ON = 1 << 2,
|
|
|
|
SCE_FRAME_DROP = 1 << 3,
|
|
|
|
SCE_KEYS_NO_SELONLY = 1 << 4,
|
|
|
|
SCE_READFILE_LIBLINK_NEED_SETSCENE_CHECK = 1 << 5,
|
2023-09-26 20:30:46 +02:00
|
|
|
SCE_CUSTOM_SIMULATION_RANGE = 1 << 6,
|
2023-06-26 04:09:49 +02:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Return flag BKE_scene_base_iter_next functions. */
|
2023-06-26 04:09:49 +02:00
|
|
|
enum {
|
|
|
|
// F_ERROR = -1, /* UNUSED. */
|
|
|
|
F_START = 0,
|
|
|
|
F_SCENE = 1,
|
|
|
|
F_DUPLI = 3,
|
|
|
|
};
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #AudioData::flag */
|
|
|
|
enum {
|
|
|
|
AUDIO_MUTE = 1 << 0,
|
|
|
|
AUDIO_SYNC = 1 << 1,
|
|
|
|
AUDIO_SCRUB = 1 << 2,
|
|
|
|
AUDIO_VOLUME_ANIMATED = 1 << 3,
|
|
|
|
};
|
Commit message and the brunt of the code courtesy of intrr, apologies for the
size of this;
Finally, the Sequencer audio support and global audio/animation sync stuff!
(See http://intrr.org/blender/audiosequencer.html)
Stuff that has been done:
./source/blender/blenloader/intern/writefile.c
./source/blender/blenloader/intern/readfile.c
Added code to make it handle sounds used by audio strips, and to convert
Scene data from older (<2.28) versions to init Scene global audio settings
(Scene->audio) to defaults.
./source/blender/include/BSE_seqaudio.h
./source/blender/src/seqaudio.c
The main audio routines that start/stop/scrub the audio stream at
a certain frame position, provide the frame reference for the current
stream position, mix the audio, convert the audio, mixdown the audio
into a file.
./source/blender/makesdna/DNA_sound_types.h
Introduced new variables in the bSound struct to accomodate the sample
data after converted to the scene's global mixing format (stream, streamlen).
Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound
belongs to a sequence strip.
./source/blender/makesdna/DNA_scene_types.h
Added AudioData struct, which holds scene-global audio settings.
./source/blender/makesdna/DNA_sequence_types.h
Added support for audio strips. Some variables to hold Panning/Attenuation
information, position information, reference to the sample, and some flags.
./source/blender/makesdna/DNA_userdef_types.h
./source/blender/src/usiblender.c
Added a "Mixing buffer size" userpref. Made the versions stuff initialize
it to a default for versions <2.28.
./source/blender/makesdna/DNA_space_types.h
./source/blender/src/filesel.c
Added a Cyan dot to .WAV files. Any other suggestions on a better color? :)
./source/blender/src/editsound.c
Changes (fixes) to the WAV file loader, re-enabled some gameengine code that
is needed for dealing with bSounds and bSamples.
./source/blender/src/editipo.c
./source/blender/src/drawseq.c
./source/blender/src/editnla.c
./source/blender/src/space.c
./source/blender/src/drawview.c
./source/blender/src/renderwin.c
./source/blender/src/headerbuttons.c
- Created two different wrappers for update_for_newframe(), one which scrubs
the audio, one which doesn't.
- Replaced some of the occurences of update_for_newframe() with
update_for_newframe_muted(), which doesn't scrub the audio.
- In drawview.c: Changed the synchronization scheme to get the current audio
position from the audio engine, and use that as a reference for setting
CFRA. Implements a/v sync and framedrop.
- In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as
volume envelopes.
- In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing
(update_for_newframe()) for moving the sequence editor framebar.
./source/blender/src/editseq.c
Added support for audio strips and a default directory for WAV files which
gets saved from the last Shift-A operation.
./source/blender/src/buttons.c
Added Scene-global audio sequencer settings in Sound buttons.
./source/blender/src/sequence.c
Various stuff that deals with handling audio strips differently than
usual strips.
2003-07-13 22:16:56 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #FFMpegCodecData::flags */
|
2013-12-10 02:59:04 +01:00
|
|
|
enum {
|
2019-12-16 23:42:12 +01:00
|
|
|
#ifdef DNA_DEPRECATED_ALLOW
|
2022-12-15 00:31:18 +01:00
|
|
|
/* DEPRECATED: you can choose none as audio-codec now. */
|
|
|
|
FFMPEG_MULTIPLEX_AUDIO = (1 << 0),
|
2015-07-10 07:58:08 +02:00
|
|
|
#endif
|
2018-12-16 23:55:02 +01:00
|
|
|
FFMPEG_AUTOSPLIT_OUTPUT = (1 << 1),
|
|
|
|
FFMPEG_LOSSLESS_OUTPUT = (1 << 2),
|
FFmpeg interface improvements
This patch changes a couple of things in the video output encoding.
{F362527}
- Clearer separation between container and codec. No more "format", as this is
too ambiguous. As a result, codecs were removed from the container list.
- Added FFmpeg speed presets, so the user can choosen from the range "Very
slow" to "Ultra fast". By default no preset is used.
- Added Constant Rate Factor (CRF) mode, which allows changing the bit-rate
depending on the desired quality and the input. This generally produces the
best quality videos, at the expense of not knowing the exact bit-rate and
file size.
- Added optional maximum of non-B-frames between B-frames (`max_b_frames`).
- Presets were adjusted for these changes, and new presets added. One of the
new presets is [recommended](https://trac.ffmpeg.org/wiki/Encode/VFX#H.264)
for reviewing videos, as it allows players to scrub through it easily. Might
be nice in weeklies. This preset also requires control over the
`max_b_frames` setting.
GUI-only changes:
- Renamed "MPEG" in the output file format menu with "FFmpeg", as this is more
accurate. After all, FFmpeg is used when this option is chosen, which can
also output non-MPEG files.
- Certain parts of the GUI are disabled when not in use:
- bit rate options are not used when a constant rate factor is given.
- audio bitrate & volume are not used when no audio is exported.
Note that I did not touch `BKE_ffmpeg_preset_set()`. There are currently two
preset systems for FFmpeg (`BKE_ffmpeg_preset_set()` and the Python preset
system). Before we do more work on `BKE_ffmpeg_preset_set()`, I think it's a
good idea to determine whether we want to keep it at all.
After this patch has been accepted, I'd be happy to go through the code and
remove any then-obsolete bits, such as the handling of "XVID" as a container
format.
Reviewers: sergey, mont29, brecht
Subscribers: mpan3, Blendify, brecht, fsiddi
Tags: #bf_blender
Differential Revision: https://developer.blender.org/D2242
2016-09-21 15:01:51 +02:00
|
|
|
FFMPEG_USE_MAX_B_FRAMES = (1 << 3),
|
2013-12-10 02:59:04 +01:00
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #Paint::flags */
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum ePaintFlags {
|
2012-12-11 23:00:22 +01:00
|
|
|
PAINT_SHOW_BRUSH = (1 << 0),
|
|
|
|
PAINT_FAST_NAVIGATE = (1 << 1),
|
2015-02-11 15:07:04 +01:00
|
|
|
PAINT_SHOW_BRUSH_ON_SURFACE = (1 << 2),
|
2019-01-15 13:57:49 +01:00
|
|
|
PAINT_USE_CAVITY_MASK = (1 << 3),
|
2020-03-12 17:51:39 +01:00
|
|
|
PAINT_SCULPT_DELAY_UPDATES = (1 << 4),
|
2017-10-17 04:43:10 +02:00
|
|
|
} ePaintFlags;
|
2009-11-03 23:50:09 +01:00
|
|
|
|
2021-02-14 10:58:04 +01:00
|
|
|
/**
|
2023-06-26 04:09:49 +02:00
|
|
|
* #Paint::symmetry_flags
|
2021-02-14 10:58:04 +01:00
|
|
|
* (for now just a duplicate of sculpt symmetry flags).
|
|
|
|
*/
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum ePaintSymmetryFlags {
|
2023-02-07 21:56:45 +01:00
|
|
|
PAINT_SYMM_NONE = 0,
|
2013-12-09 21:36:33 +01:00
|
|
|
PAINT_SYMM_X = (1 << 0),
|
|
|
|
PAINT_SYMM_Y = (1 << 1),
|
|
|
|
PAINT_SYMM_Z = (1 << 2),
|
2015-07-23 22:52:03 +02:00
|
|
|
PAINT_SYMMETRY_FEATHER = (1 << 3),
|
|
|
|
PAINT_TILE_X = (1 << 4),
|
|
|
|
PAINT_TILE_Y = (1 << 5),
|
|
|
|
PAINT_TILE_Z = (1 << 6),
|
2017-10-17 04:43:10 +02:00
|
|
|
} ePaintSymmetryFlags;
|
2022-11-10 02:27:41 +01:00
|
|
|
ENUM_OPERATORS(ePaintSymmetryFlags, PAINT_TILE_Z);
|
2023-06-26 04:09:49 +02:00
|
|
|
#define PAINT_SYMM_AXIS_ALL (PAINT_SYMM_X | PAINT_SYMM_Y | PAINT_SYMM_Z)
|
|
|
|
|
2023-02-07 21:56:45 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
inline ePaintSymmetryFlags operator++(ePaintSymmetryFlags &flags, int)
|
|
|
|
{
|
|
|
|
flags = ePaintSymmetryFlags(char(flags) + 1);
|
|
|
|
return flags;
|
|
|
|
}
|
|
|
|
#endif
|
2013-12-09 21:36:33 +01:00
|
|
|
|
2021-02-14 10:58:04 +01:00
|
|
|
/**
|
2023-06-26 04:09:49 +02:00
|
|
|
* #Sculpt::flags
|
2021-02-14 10:58:04 +01:00
|
|
|
* These can eventually be moved to paint flags?
|
|
|
|
*/
|
2017-10-17 04:43:10 +02:00
|
|
|
typedef enum eSculptFlags {
|
2019-03-17 00:28:08 +01:00
|
|
|
SCULPT_FLAG_UNUSED_0 = (1 << 0), /* cleared */
|
|
|
|
SCULPT_FLAG_UNUSED_1 = (1 << 1), /* cleared */
|
|
|
|
SCULPT_FLAG_UNUSED_2 = (1 << 2), /* cleared */
|
2013-12-09 21:36:33 +01:00
|
|
|
|
2013-04-13 02:43:49 +02:00
|
|
|
SCULPT_LOCK_X = (1 << 3),
|
|
|
|
SCULPT_LOCK_Y = (1 << 4),
|
|
|
|
SCULPT_LOCK_Z = (1 << 5),
|
2018-12-17 03:21:49 +01:00
|
|
|
|
2019-03-17 00:28:08 +01:00
|
|
|
SCULPT_FLAG_UNUSED_6 = (1 << 6), /* cleared */
|
2013-12-09 21:36:33 +01:00
|
|
|
|
2020-06-29 18:16:15 +02:00
|
|
|
SCULPT_FLAG_UNUSED_7 = (1 << 7), /* cleared */
|
2013-04-13 02:43:49 +02:00
|
|
|
SCULPT_ONLY_DEFORM = (1 << 8),
|
2019-08-04 17:53:48 +02:00
|
|
|
// SCULPT_SHOW_DIFFUSE = (1 << 9), /* deprecated */
|
2012-12-30 19:27:33 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** If set, the mesh will be drawn with smooth-shading in dynamic-topology mode. */
|
2023-07-28 13:44:01 +02:00
|
|
|
SCULPT_FLAG_UNUSED_8 = (1 << 10), /* deprecated */
|
2012-12-30 19:27:33 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** If set, dynamic-topology brushes will subdivide short edges. */
|
2013-11-19 21:55:46 +01:00
|
|
|
SCULPT_DYNTOPO_SUBDIVIDE = (1 << 12),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** If set, dynamic-topology brushes will collapse short edges. */
|
2014-03-06 19:04:57 +01:00
|
|
|
SCULPT_DYNTOPO_COLLAPSE = (1 << 11),
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** If set, dynamic-topology detail size will be constant in object space. */
|
2015-05-06 22:51:49 +02:00
|
|
|
SCULPT_DYNTOPO_DETAIL_CONSTANT = (1 << 13),
|
|
|
|
SCULPT_DYNTOPO_DETAIL_BRUSH = (1 << 14),
|
2022-12-23 01:52:44 +01:00
|
|
|
/* unused = (1 << 15), */
|
2018-07-02 18:35:50 +02:00
|
|
|
SCULPT_DYNTOPO_DETAIL_MANUAL = (1 << 16),
|
2017-10-17 04:43:10 +02:00
|
|
|
} eSculptFlags;
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #Sculpt::transform_mode */
|
2022-06-04 04:21:04 +02:00
|
|
|
typedef enum eSculptTransformMode {
|
|
|
|
SCULPT_TRANSFORM_MODE_ALL_VERTICES = 0,
|
|
|
|
SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC = 1,
|
|
|
|
} eSculptTrasnformMode;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #PaintModeSettings::mode */
|
2022-04-08 16:37:35 +02:00
|
|
|
typedef enum ePaintCanvasSource {
|
|
|
|
/** Paint on the active node of the active material slot. */
|
|
|
|
PAINT_CANVAS_SOURCE_MATERIAL = 0,
|
|
|
|
/** Paint on a selected image. */
|
|
|
|
PAINT_CANVAS_SOURCE_IMAGE = 1,
|
|
|
|
/** Paint on the active color attribute (vertex color) layer. */
|
|
|
|
PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE = 2,
|
|
|
|
} ePaintCanvasSource;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ImagePaintSettings::mode */
|
2022-04-08 16:37:35 +02:00
|
|
|
/* Defines to let old texture painting use the new enum. */
|
|
|
|
/* TODO(jbakker): rename usages. */
|
|
|
|
#define IMAGEPAINT_MODE_MATERIAL PAINT_CANVAS_SOURCE_MATERIAL
|
|
|
|
#define IMAGEPAINT_MODE_IMAGE PAINT_CANVAS_SOURCE_IMAGE
|
2014-08-28 16:40:38 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ImagePaintSettings::interp */
|
2018-12-23 16:26:21 +01:00
|
|
|
enum {
|
|
|
|
IMAGEPAINT_INTERP_LINEAR = 0,
|
2020-04-24 07:49:25 +02:00
|
|
|
IMAGEPAINT_INTERP_CLOSEST = 1,
|
2018-12-23 16:26:21 +01:00
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ImagePaintSettings::flag */
|
|
|
|
enum {
|
|
|
|
IMAGEPAINT_DRAWING = 1 << 0,
|
|
|
|
// IMAGEPAINT_DRAW_TOOL = 1 << 1, /* Deprecated. */
|
|
|
|
// IMAGEPAINT_DRAW_TOOL_DRAWING = 1 << 2, /* Deprecated. */
|
|
|
|
};
|
2010-12-12 15:28:23 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/* Projection painting only. */
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ImagePaintSettings::flag */
|
|
|
|
enum {
|
|
|
|
IMAGEPAINT_PROJECT_XRAY = 1 << 4,
|
|
|
|
IMAGEPAINT_PROJECT_BACKFACE = 1 << 5,
|
|
|
|
IMAGEPAINT_PROJECT_FLAT = 1 << 6,
|
|
|
|
IMAGEPAINT_PROJECT_LAYER_CLONE = 1 << 7,
|
|
|
|
IMAGEPAINT_PROJECT_LAYER_STENCIL = 1 << 8,
|
|
|
|
IMAGEPAINT_PROJECT_LAYER_STENCIL_INV = 1 << 9,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ImagePaintSettings::missing_data */
|
|
|
|
enum {
|
|
|
|
IMAGEPAINT_MISSING_UVS = 1 << 0,
|
|
|
|
IMAGEPAINT_MISSING_MATERIAL = 1 << 1,
|
|
|
|
IMAGEPAINT_MISSING_TEX = 1 << 2,
|
|
|
|
IMAGEPAINT_MISSING_STENCIL = 1 << 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ToolSettings::uvcalc_flag */
|
|
|
|
enum {
|
|
|
|
UVCALC_FILLHOLES = 1 << 0,
|
|
|
|
/** Would call this UVCALC_ASPECT_CORRECT, except it should be default with old file. */
|
|
|
|
UVCALC_NO_ASPECT_CORRECT = 1 << 1,
|
|
|
|
/** Adjust UVs while transforming with Vert or Edge Slide. */
|
|
|
|
UVCALC_TRANSFORM_CORRECT_SLIDE = 1 << 2,
|
|
|
|
/** Use mesh data after subsurf to compute UVs. */
|
|
|
|
UVCALC_USESUBSURF = 1 << 3,
|
|
|
|
/** Adjust UVs while transforming to avoid distortion */
|
|
|
|
UVCALC_TRANSFORM_CORRECT = 1 << 4,
|
|
|
|
/** Keep equal values merged while correcting custom-data. */
|
|
|
|
UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED = 1 << 5,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ToolSettings::uv_flag */
|
|
|
|
enum {
|
|
|
|
UV_SYNC_SELECTION = 1,
|
|
|
|
UV_SHOW_SAME_IMAGE = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ToolSettings::uv_selectmode */
|
|
|
|
enum {
|
|
|
|
UV_SELECT_VERTEX = 1 << 0,
|
|
|
|
UV_SELECT_EDGE = 1 << 1,
|
|
|
|
UV_SELECT_FACE = 1 << 2,
|
|
|
|
UV_SELECT_ISLAND = 1 << 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ToolSettings::uv_sticky */
|
2022-02-16 03:46:00 +01:00
|
|
|
enum {
|
|
|
|
SI_STICKY_LOC = 0,
|
|
|
|
SI_STICKY_DISABLE = 1,
|
|
|
|
SI_STICKY_VERTEX = 2,
|
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::gpencil_flags */
|
2015-12-13 09:03:13 +01:00
|
|
|
typedef enum eGPencil_Flags {
|
2023-11-02 17:10:59 +01:00
|
|
|
/** Enables multi-frame editing. */
|
|
|
|
GP_USE_MULTI_FRAME_EDITING = (1 << 0),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** When creating new frames, the last frame gets used as the basis for the new one. */
|
2015-12-13 09:03:13 +01:00
|
|
|
GP_TOOL_FLAG_RETAIN_LAST = (1 << 1),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Add the strokes below all strokes in the layer. */
|
2018-07-31 10:22:19 +02:00
|
|
|
GP_TOOL_FLAG_PAINT_ONBACK = (1 << 2),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Show compact list of colors. */
|
2018-08-30 11:11:10 +02:00
|
|
|
GP_TOOL_FLAG_THUMBNAIL_LIST = (1 << 3),
|
2023-01-16 03:57:10 +01:00
|
|
|
/** Generate weight data for new strokes. */
|
2018-08-30 11:11:10 +02:00
|
|
|
GP_TOOL_FLAG_CREATE_WEIGHTS = (1 << 4),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Auto-merge with last stroke. */
|
2020-11-18 21:30:43 +01:00
|
|
|
GP_TOOL_FLAG_AUTOMERGE_STROKE = (1 << 5),
|
2015-12-13 09:03:13 +01:00
|
|
|
} eGPencil_Flags;
|
Grease Pencil Todos: "Sketching Sessions"
Due to popular request and usability considerations, this commit
reintroduces functionality similar to 2.4's "Draw Mode" for Grease
Pencil.
In the toolbar under the Draw/Line/Eraser buttons, you can find the
"Use Sketching Sessions" toggle, which enables this feature. This is a
per-scene setting, and defaults to off, so that the current 2.5
behaviour is still the default (i.e. the Grease Pencil operator will
only do a single stroke at a time).
With this option enabled, drawing with Grease Pencil will enter a
semi-modal state where you can draw multiple strokes without needing
to keep holding the DKEY throughout (though you'll still need to do so
to start the strokes, unless you use some toolbar buttons), while
still being able to manipulate the viewport. Header help-text prints
show the appropriate keybindings (i.e. press ESCKEY or ENTER to end
the sketching session).
Notes:
- To aid maintainability of the 3D-View toolbar code, I've taken the
liberty to factor out the groups of widgets which commonly occur in
most of the toolbars into separate functions (namely "Repeat" and
"Grease Pencil"). Perhaps it might make it slightly harder to newbies
to the toolbar code to grasp, though the physics panels are far worse
;)
- I've reshuffled some code in the Grease Pencil code to separate out
the various states of operation again more clearly, though some more
work is still needed there (TODO)
- There can now be only one Grease Pencil operator running at a time
- Redoing Grease Pencil operations where sketching sessions was
enabled still needs work. Namely, a way of delimiting the set of
points recorded into strokes is still needed (TODO)
- Ultimately, it should be possible to switch tools midway through a
session. Currently sessions are limited to only being able to be used
with a single drawing mode (TODO)
- After ending a drawing session, the titlebar contols may not work on
Windows without manually making the main window lose focus and then
regain (i.e. click on some other window in toolbar, then come back).
This may be related to (bug #25480)
2011-01-04 04:14:01 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #Scene::r.simplify_gpencil */
|
2018-07-31 10:22:19 +02:00
|
|
|
typedef enum eGPencil_SimplifyFlags {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Simplify. */
|
2018-07-31 10:22:19 +02:00
|
|
|
SIMPLIFY_GPENCIL_ENABLE = (1 << 0),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Simplify on play. */
|
2018-07-31 10:22:19 +02:00
|
|
|
SIMPLIFY_GPENCIL_ON_PLAY = (1 << 1),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Simplify fill on viewport. */
|
2018-07-31 10:22:19 +02:00
|
|
|
SIMPLIFY_GPENCIL_FILL = (1 << 2),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Simplify modifier on viewport. */
|
2018-07-31 10:22:19 +02:00
|
|
|
SIMPLIFY_GPENCIL_MODIFIER = (1 << 3),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Simplify Shader FX. */
|
2018-11-26 18:12:39 +01:00
|
|
|
SIMPLIFY_GPENCIL_FX = (1 << 5),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Simplify layer tint. */
|
2019-09-10 17:37:27 +02:00
|
|
|
SIMPLIFY_GPENCIL_TINT = (1 << 7),
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Simplify Anti-aliasing. */
|
2020-03-09 16:27:24 +01:00
|
|
|
SIMPLIFY_GPENCIL_AA = (1 << 8),
|
2018-07-31 10:22:19 +02:00
|
|
|
} eGPencil_SimplifyFlags;
|
2014-12-07 14:42:10 +01:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** `ToolSettings.gpencil_*_align` - Stroke Placement mode flags. */
|
2015-12-13 09:03:13 +01:00
|
|
|
typedef enum eGPencil_Placement_Flags {
|
2022-12-15 00:31:18 +01:00
|
|
|
/** New strokes are added in viewport/data space (i.e. not screen space). */
|
2015-12-13 09:03:13 +01:00
|
|
|
GP_PROJECT_VIEWSPACE = (1 << 0),
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
// /** Viewport space, but relative to render canvas (Sequencer Preview Only) */
|
|
|
|
// GP_PROJECT_CANVAS = (1 << 1), /* UNUSED */
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** Project into the screen's Z values. */
|
2015-12-13 09:03:13 +01:00
|
|
|
GP_PROJECT_DEPTH_VIEW = (1 << 2),
|
|
|
|
GP_PROJECT_DEPTH_STROKE = (1 << 3),
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** "Use Endpoints". */
|
2015-12-13 09:03:13 +01:00
|
|
|
GP_PROJECT_DEPTH_STROKE_ENDPOINTS = (1 << 4),
|
2018-07-31 10:22:19 +02:00
|
|
|
GP_PROJECT_CURSOR = (1 << 5),
|
2018-11-01 16:42:34 +01:00
|
|
|
GP_PROJECT_DEPTH_STROKE_FIRST = (1 << 6),
|
2015-12-13 09:03:13 +01:00
|
|
|
} eGPencil_Placement_Flags;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::gpencil_selectmode */
|
2018-09-20 11:32:59 +02:00
|
|
|
typedef enum eGPencil_Selectmode_types {
|
2019-01-11 19:15:23 +01:00
|
|
|
GP_SELECTMODE_POINT = 0,
|
|
|
|
GP_SELECTMODE_STROKE = 1,
|
2019-01-15 13:57:49 +01:00
|
|
|
GP_SELECTMODE_SEGMENT = 2,
|
2018-09-20 11:32:59 +02:00
|
|
|
} eGPencil_Selectmode_types;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::gpencil_guide_types */
|
2019-01-11 19:15:23 +01:00
|
|
|
typedef enum eGPencil_GuideTypes {
|
|
|
|
GP_GUIDE_CIRCULAR = 0,
|
2020-04-24 07:49:25 +02:00
|
|
|
GP_GUIDE_RADIAL = 1,
|
|
|
|
GP_GUIDE_PARALLEL = 2,
|
|
|
|
GP_GUIDE_GRID = 3,
|
|
|
|
GP_GUIDE_ISO = 4,
|
2019-01-11 19:15:23 +01:00
|
|
|
} eGPencil_GuideTypes;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::gpencil_guide_references */
|
2019-01-11 19:15:23 +01:00
|
|
|
typedef enum eGPencil_Guide_Reference {
|
|
|
|
GP_GUIDE_REF_CURSOR = 0,
|
2020-04-24 07:49:25 +02:00
|
|
|
GP_GUIDE_REF_CUSTOM = 1,
|
|
|
|
GP_GUIDE_REF_OBJECT = 2,
|
2019-01-11 19:15:23 +01:00
|
|
|
} eGPencil_Guide_Reference;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #ToolSettings::particle flag */
|
|
|
|
enum {
|
|
|
|
PE_KEEP_LENGTHS = 1 << 0,
|
|
|
|
PE_LOCK_FIRST = 1 << 1,
|
|
|
|
PE_DEFLECT_EMITTER = 1 << 2,
|
|
|
|
PE_INTERPOLATE_ADDED = 1 << 3,
|
|
|
|
PE_DRAW_PART = 1 << 4,
|
|
|
|
PE_UNUSED_6 = 1 << 6, /* cleared */
|
|
|
|
PE_FADE_TIME = 1 << 7,
|
|
|
|
PE_AUTO_VELOCITY = 1 << 8,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ParticleEditSettings::brushtype */
|
|
|
|
enum {
|
|
|
|
PE_BRUSH_NONE = -1,
|
|
|
|
PE_BRUSH_COMB = 0,
|
|
|
|
PE_BRUSH_CUT = 1,
|
|
|
|
PE_BRUSH_LENGTH = 2,
|
|
|
|
PE_BRUSH_PUFF = 3,
|
|
|
|
PE_BRUSH_ADD = 4,
|
|
|
|
PE_BRUSH_SMOOTH = 5,
|
|
|
|
PE_BRUSH_WEIGHT = 6,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ParticleBrushData::flag */
|
|
|
|
enum {
|
|
|
|
PE_BRUSH_DATA_PUFF_VOLUME = 1 << 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #ParticleBrushData::edittype */
|
|
|
|
enum {
|
|
|
|
PE_TYPE_PARTICLES = 0,
|
|
|
|
PE_TYPE_SOFTBODY = 1,
|
|
|
|
PE_TYPE_CLOTH = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #PhysicsSettings::flag */
|
|
|
|
enum {
|
|
|
|
PHYS_GLOBAL_GRAVITY = 1,
|
|
|
|
};
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-10-01 00:10:14 +02:00
|
|
|
|
2009-09-19 00:25:49 +02:00
|
|
|
/* UnitSettings */
|
|
|
|
|
2018-10-03 10:20:16 +02:00
|
|
|
#define USER_UNIT_ADAPTIVE 0xFF
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #UnitSettings::system */
|
|
|
|
enum {
|
|
|
|
USER_UNIT_NONE = 0,
|
|
|
|
USER_UNIT_METRIC = 1,
|
|
|
|
USER_UNIT_IMPERIAL = 2,
|
|
|
|
};
|
|
|
|
/** #UnitSettings::flag */
|
|
|
|
enum {
|
|
|
|
USER_UNIT_OPT_SPLIT = 1,
|
|
|
|
USER_UNIT_ROT_RADIANS = 2,
|
|
|
|
};
|
2009-09-19 00:25:49 +02:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #SceneEEVEE::flag */
|
2018-05-16 19:34:24 +02:00
|
|
|
enum {
|
2019-05-16 21:41:22 +02:00
|
|
|
// SCE_EEVEE_VOLUMETRIC_ENABLED = (1 << 0), /* Unused */
|
2018-05-16 19:34:24 +02:00
|
|
|
SCE_EEVEE_VOLUMETRIC_LIGHTS = (1 << 1),
|
|
|
|
SCE_EEVEE_VOLUMETRIC_SHADOWS = (1 << 2),
|
2018-07-23 17:40:34 +02:00
|
|
|
// SCE_EEVEE_VOLUMETRIC_COLORED = (1 << 3), /* Unused */
|
2018-05-16 19:34:24 +02:00
|
|
|
SCE_EEVEE_GTAO_ENABLED = (1 << 4),
|
|
|
|
SCE_EEVEE_GTAO_BENT_NORMALS = (1 << 5),
|
|
|
|
SCE_EEVEE_GTAO_BOUNCE = (1 << 6),
|
2019-05-17 16:57:31 +02:00
|
|
|
// SCE_EEVEE_DOF_ENABLED = (1 << 7), /* Moved to camera->dof.flag */
|
2018-05-16 19:34:24 +02:00
|
|
|
SCE_EEVEE_BLOOM_ENABLED = (1 << 8),
|
|
|
|
SCE_EEVEE_MOTION_BLUR_ENABLED = (1 << 9),
|
|
|
|
SCE_EEVEE_SHADOW_HIGH_BITDEPTH = (1 << 10),
|
|
|
|
SCE_EEVEE_TAA_REPROJECTION = (1 << 11),
|
2019-05-16 16:43:41 +02:00
|
|
|
// SCE_EEVEE_SSS_ENABLED = (1 << 12), /* Unused */
|
2019-08-22 16:04:25 +02:00
|
|
|
// SCE_EEVEE_SSS_SEPARATE_ALBEDO = (1 << 13), /* Unused */
|
2018-05-16 19:34:24 +02:00
|
|
|
SCE_EEVEE_SSR_ENABLED = (1 << 14),
|
|
|
|
SCE_EEVEE_SSR_REFRACTION = (1 << 15),
|
|
|
|
SCE_EEVEE_SSR_HALF_RESOLUTION = (1 << 16),
|
2018-07-10 15:02:25 +02:00
|
|
|
SCE_EEVEE_SHOW_IRRADIANCE = (1 << 17),
|
|
|
|
SCE_EEVEE_SHOW_CUBEMAPS = (1 << 18),
|
|
|
|
SCE_EEVEE_GI_AUTOBAKE = (1 << 19),
|
2018-10-28 21:41:40 +01:00
|
|
|
SCE_EEVEE_SHADOW_SOFT = (1 << 20),
|
2018-10-31 18:31:14 +01:00
|
|
|
SCE_EEVEE_OVERSCAN = (1 << 21),
|
2021-02-12 22:35:18 +01:00
|
|
|
SCE_EEVEE_DOF_HQ_SLIGHT_FOCUS = (1 << 22),
|
|
|
|
SCE_EEVEE_DOF_JITTER = (1 << 23),
|
2023-02-09 00:48:33 +01:00
|
|
|
SCE_EEVEE_SHADOW_ENABLED = (1 << 24),
|
2023-08-03 15:32:06 +02:00
|
|
|
SCE_EEVEE_RAYTRACE_OPTIONS_SPLIT = (1 << 25),
|
2018-05-16 19:34:24 +02:00
|
|
|
};
|
|
|
|
|
2023-08-03 15:32:06 +02:00
|
|
|
typedef enum RaytraceEEVEE_Flag {
|
|
|
|
RAYTRACE_EEVEE_USE_DENOISE = (1 << 0),
|
|
|
|
} RaytraceEEVEE_Flag;
|
|
|
|
|
|
|
|
typedef enum RaytraceEEVEE_DenoiseStages {
|
|
|
|
RAYTRACE_EEVEE_DENOISE_SPATIAL = (1 << 0),
|
|
|
|
RAYTRACE_EEVEE_DENOISE_TEMPORAL = (1 << 1),
|
|
|
|
RAYTRACE_EEVEE_DENOISE_BILATERAL = (1 << 2),
|
|
|
|
} RaytraceEEVEE_DenoiseStages;
|
|
|
|
|
|
|
|
typedef enum RaytraceEEVEE_Method {
|
|
|
|
RAYTRACE_EEVEE_METHOD_NONE = 0,
|
|
|
|
RAYTRACE_EEVEE_METHOD_SCREEN = 1,
|
2023-08-05 05:46:22 +02:00
|
|
|
/* TODO(fclem): Hardware ray-tracing. */
|
2023-08-03 15:32:06 +02:00
|
|
|
// RAYTRACE_EEVEE_METHOD_HARDWARE = 2,
|
|
|
|
} RaytraceEEVEE_Method;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #SceneEEVEE::shadow_method */
|
2018-05-16 19:34:24 +02:00
|
|
|
enum {
|
|
|
|
SHADOW_ESM = 1,
|
2020-02-20 00:21:23 +01:00
|
|
|
/* SHADOW_VSM = 2, */ /* UNUSED */
|
|
|
|
/* SHADOW_METHOD_MAX = 3, */ /* UNUSED */
|
2018-05-16 19:34:24 +02:00
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #SceneEEVEE::motion_blur_position */
|
2020-10-13 16:55:19 +02:00
|
|
|
enum {
|
|
|
|
SCE_EEVEE_MB_CENTER = 0,
|
|
|
|
SCE_EEVEE_MB_START = 1,
|
|
|
|
SCE_EEVEE_MB_END = 2,
|
|
|
|
};
|
|
|
|
|
2021-02-14 10:58:04 +01:00
|
|
|
/** #SceneDisplay->render_aa and #SceneDisplay->viewport_aa */
|
2019-05-02 15:18:53 +02:00
|
|
|
enum {
|
|
|
|
SCE_DISPLAY_AA_OFF = 0,
|
|
|
|
SCE_DISPLAY_AA_FXAA = 1,
|
|
|
|
SCE_DISPLAY_AA_SAMPLES_5 = 5,
|
|
|
|
SCE_DISPLAY_AA_SAMPLES_8 = 8,
|
|
|
|
SCE_DISPLAY_AA_SAMPLES_11 = 11,
|
|
|
|
SCE_DISPLAY_AA_SAMPLES_16 = 16,
|
|
|
|
SCE_DISPLAY_AA_SAMPLES_32 = 32,
|
|
|
|
};
|
|
|
|
|
2023-08-04 15:06:12 +02:00
|
|
|
/** #SceneHydra->export_method */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
SCE_HYDRA_EXPORT_HYDRA = 0,
|
|
|
|
SCE_HYDRA_EXPORT_USD = 1,
|
|
|
|
};
|
|
|
|
|
2022-12-15 00:31:18 +01:00
|
|
|
/** \} */
|