Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-04-01Nodes: separate node name and display name in bNodeTreePathJacques Lucke
Previously, `node_name` was rarely actually a name of a node. It is set correctly as node name in `ED_node_tree_push`. However, later on it was overwritten by the name of an id data block in `node_draw_space`. Now, the node_name stays the name of the "parent" node. Whereas display_name is the name that will be displayed in the breadcrumbs. With this change, the `node_name` can be used to reconstruct the actual path from the root node tree to the currently visible tree. Differential Revision: https://developer.blender.org/D10874
2021-03-15Geometry Nodes: Support drag & drop object to create Object Info, Collection ↵Charlie Jolly
Info and Sample Texture nodes See: {T86296} Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10648
2021-02-16Assets: Remove appended asset when dropping operation failsJulian Eisel
When dropping an asset somewhere, it is appended and then a drop operation is called to actually add it to the scene based on current context. If this drop operation fails, the appended data-block is now still in the .blend. The user may not notice and not expect this. Instead idea is to rollback any changes done by dropping code if the operation fails, namely removing the appended data-block again. Adds a new `cancel()` callback which is called if the drop operator returns `OPERATOR_CANCELLED` to drop-boxes and a generic function to deal with assets on drop failure. Also removes the `free_id_on_error` property of the `NODE_OT_add_group` operator, which was used as ad-hoc solution to get this same behavior.
2021-02-15UI/Nodes: Adding node groups via drag & drop (e.g. from Asset Browser)Julian Eisel
Adds `NODE_OT_add_group` operator to add a node group from a given name, and uses that to register a node editor drop-box. When dropping a node-group asset, the ID will be appended. This is what we do for other ID assets too. Should the node group insertion fail (e.g. the group is not compatible with the current tree, as checked by the poll), the appended data-block is removed. Differential Revision: https://developer.blender.org/D10405 Reviewed by: Jacques Lucke
2021-02-15Merge branch 'blender-v2.92-release'Jacques Lucke
2021-02-15Fix T84624: node group data-block has phantom userJacques Lucke
This is because the node editor added a "real user" to the node group that it displays. It was mainly added as a hack to solve issues with custom tree types (T36024). Since we can store id references in custom properties now, this "real user" is not really necessary anymore. Given that we are close to a release, I'll only disable line for geometry nodes, for which the bug has been reported. Discussed this solution with Hans Goudey.
2021-02-10Cleanup: remove redundant headers in source/blender/editors/Campbell Barton
Remove redundant headers using `./source/tools/utils_maintenance/code_clean.py` Reviewed By: jmonteath Ref D10364
2021-01-24Cleanup: Add/use helper to check if dragging a certain ID type or asset ID typeJulian Eisel
This check is a common pattern, avoid duplication by using a helper function.
2021-01-24Asset Browser: Support dragging mask assets into compositorsJulian Eisel
The normal drag & drop support was already there, just needed minor tweaks to respect asset importing. The dragged in mask will create a mask node for compositor node editors. Part of T82661.
2021-01-24Asset Browser: Support dragging image assets into node editorsJulian Eisel
The normal drag & drop support was already there, just needed minor tweaks to respect asset importing. The dragged in image will create a image/texture node for the internally known node-tree types (shader, texture and compositing nodes). Part of T82661.
2021-01-20Cleanup: Store runtime space node variables in a separate structHans Goudey
This commit moves runtime-only variables from the `SpaceNode` DNA struct to a private struct in `node_intern.h`. Before, it was hard to tell which data needed to be saved in files, this should make it more clear. Node that the `edittree` field is basically a runtime variable, since it's set from the `treepath` list on read, but moving it would require some more invasive changes that I don't think are worth it right now. Also, not all of the moved variables were explicitly cleared on read-- `aspect` is set at the start of a redraw, `cursor` is set in a region callback, and `recalc` was used as an update flag. Differential Revision: https://developer.blender.org/D10141
2021-01-19Cleanup: use 'const' argument for parameter argumentCampbell Barton
2021-01-19UI Code Quality: Use "params" struct for area and region callbacksHans Goudey
These functions with many arguments can be unwieldy. Aside from the obvious issues with rewriting the list of arguments and the opportunities for error and frustration that presents, the long list of arguments make these systems hard to change. So when an argument should be added, someone might skip that and add some hack instead. So, as proposed in T73586#1037210, this patch instead uses a "params" struct for each of these callbacks. - Use param argument for `ARegionType.listener` - Remove unused window field in region listener - Use param argument for `SpaceType.listener` - Use params struct for `ARegionType.message_subscribe` Differential Revision: https://developer.blender.org/D9750
2020-12-15Asset System: Support dragging assets and appending on dropJulian Eisel
For the Asset Browser, it needs to be possible to drag assets into various editors, which may not come from the current .blend file. In other words, the dragging needs to work with just the asset metadata, without direct access to the data-block itself. Idea is simple: When dragging an asset, store the source file-path and data-block name and when dropping, append the data-block. It uses existing drop operators, but the function to get the dropped data-block is replaced with one that returns the local data-block, or, in case of an external asset, appends the data-block first. The drop operators need to be adjusted to use this new function that respects assets. With this patch it only works for dragging assets into the 3D view. Note that I expect this to be a short-lived change. A refactor like D4071 is needed to make the drag & drop system more future proof for assets and other use cases. Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Differential Revision: https://developer.blender.org/D9721 Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-02Preferences: remove Geometry Nodes from experimentalDalai Felinto
2020-12-02Geometry Nodes: active modifier + geometry nodes editorHans Goudey
This commit adds functions to set and get the object's active modifier, which is stored as a flag in the ModifierData struct, similar to constraints. This will be used to set the context in the node editor. There are no visible changes in this commit. Similar to how the node editor context works for materials, this commit makes the node group displayed in the node editor depend on the active object and its active modifier. To keep the node group from changing, just pin the node group in the header. * Shortcuts performed while there is an active modifier will affect only that modifier (the exception is the A to expand the modifiers). * Clicking anywhere on the empty space in a modifier's panel will make it active. These changes require some refactoring of object modifier code. First is splitting up the modifier property invoke callback, which now needs to be able to get the active modifier separately from the hovered modifier for the different operators. Second is a change to removing modifiers, where there is now a separate function to remove a modifier from an object's list, in order to handle changing the active. Finally, the panel handler needs a small tweak so that this "click in panel" event can be handled afterwards.
2020-12-02Geometry Nodes: initial scattering and geometry nodesJacques Lucke
This is the initial merge from the geometry-nodes branch. Nodes: * Attribute Math * Boolean * Edge Split * Float Compare * Object Info * Point Distribute * Point Instance * Random Attribute * Random Float * Subdivision Surface * Transform * Triangulate It includes the initial evaluation of geometry node groups in the Geometry Nodes modifier. Notes on the Generic attribute access API The API adds an indirection for attribute access. That has the following benefits: * Most code does not have to care about how an attribute is stored internally. This is mainly necessary, because we have to deal with "legacy" attributes such as vertex weights and attributes that are embedded into other structs such as vertex positions. * When reading from an attribute, we generally don't care what domain the attribute is stored on. So we want to abstract away the interpolation that that adapts attributes from one domain to another domain (this is not actually implemented yet). Other possible improvements for later iterations include: * Actually implement interpolation between domains. * Don't use inheritance for the different attribute types. A single class for read access and one for write access might be enough, because we know all the ways in which attributes are stored internally. We don't want more different internal structures in the future. On the contrary, ideally we can consolidate the different storage formats in the future to reduce the need for this indirection. * Remove the need for heap allocations when creating attribute accessors. It includes commits from: * Dalai Felinto * Hans Goudey * Jacques Lucke * Léo Depoix
2020-11-20Cleanup: Use LISTBASE_FOREACH macroHans Goudey
2020-10-21Preferences: separate feature flags for geometry nodes and point cloud typeJacques Lucke
Those two features are not directly related and one might be activated in master earlier than the other. WITH_PARTICLE_NODES was removed, because we continue the project under the name "Geometry Nodes".
2020-10-02Cleanup: Use enum for return values in context callbacksSybren A. Stüvel
Define enum `eContextResult` and use its values for returns, instead of just returning 1, 0, or -1 (and always having some comment that explains what -1 means). This also cleans up the mixup between returning `0` and `false`, and `1` and `true`. An inconsistency was discovered during this cleanup, and marked with `TODO(sybren)`. It's not fixed here, as it would consititute a functional change. The enum isn't used everywhere, as enums in C and C++ can have different storage sizes. To prevent issues, callback functions are still declared as returning`int`. To at least make things easier to understand for humans, I marked those with `int /*eContextResult*/`. This is a followup of D9090, and is intended to unify how context callbacks return values. This will make it easier to extend the approach in D9090 to those functions. No functional changes. Differential Revision: https://developer.blender.org/D9095
2020-10-02CleanUp: snode_group_offset -> space_node_group_offsetJeroen Bakker
2020-10-02CleanUp: Renamed drawnodespace -> node_draw_spaceJeroen Bakker
2020-08-04Refactor: rename SpaceType->new to SpaceType->createJacques Lucke
The data member `new` was conflicting with the `new` keyword when `BKE_screen.h` was included in C++ files. Reviewers: sergey Differential Revision: https://developer.blender.org/D8459
2020-07-03Cleanup: Editors/Space/Node, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors/space_node` module. No functional changes.
2020-06-23Preferences: New experimental settings for particle system and hairJacques Lucke
This replaces the cmake options `WITH_NEW_OBJECT_TYPES` and `WITH_NEW_SIMULATION_TYPE` with two experimental userpref settings: * `use_new_particle_system`: Enables the point cloud type and the simulation editor. * `use_new_hair_type`: Only displays the add-operator in the add menu for now. Note, in the current state you can't do anything productive with the new particle system or the new hair type. Features will be added step by step in the upcoming weeks and months. Reviewers: brecht Differential Revision: https://developer.blender.org/D8096
2020-05-11Merge branch 'blender-v2.83-release'Bastien Montagne
2020-05-11Fix T76559: Crash after deleting material leaves invalid pointer in node editor.Bastien Montagne
No idea why node editor remap callback was only handling scene IDs (and not any other ntree owner)... Note that this should be a safe fix, but it unvails a nice can of worm, at some point we should ba able to handle all of that through libquery only, get rid of editor's remap callbacks, and probably sanitize usages of ID pointers by some of them, like that nodetree editor. Current situation remains a fairly fragile mess...
2020-04-20Simulations: Add simulation node tree typeJacques Lucke
This implements a new builtin node tree type called `SimulationNodeTree`. It is not yet embedded in the `Simulation` data block. The node tree will initially be used for the new particle nodes system. When the cmake option `WITH_NEW_SIMULATION_TYPE` is enabled, a new `Simulation Editor` is shown in the editors menu (which is just a node editor). This patch does not add entries to the Add Node menu, so it is empty. Reviewers: brecht Differential Revision: https://developer.blender.org/D7287
2020-04-16Fix T75680: Nodegroup user count increased when file saved in edit group mode.Bastien Montagne
This editor's code was a bit schizophrenic, some parts considering its nodetree usages as real refcounted ones, others, as shallow 'user one' ones... Editors should not be real ID users anyway, unless there are *very* good reasons for it, so swich it to fully 'shallow' usage now.
2020-04-03Cleanup: Rename ScrArea variables from sa to areaJulian Eisel
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432. Now the area and region naming conventions should be less confusing. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
2020-03-25Cleanup: use 'r_' prefix for output argumentsCampbell Barton
Also pass some args as 'const'.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-12Fix T73212: Gizmo's are still interactive when behind nodesCampbell Barton
2020-03-06Cleanup: Rename ARegion variables from ar to regionJulian Eisel
The old convention was easy to confuse with ScrArea. Part of https://developer.blender.org/T74432. This is mostly a batch rename with some manual fixing. Only single word variable names are changed, no prefixed/suffixed names. Brecht van Lommel and Campbell Barton both gave me a green light for this convention change. Also ran clan clang format on affected files.
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2019-09-07Cleanup: use post increment/decrementCampbell Barton
When the result isn't used, prefer post increment/decrement (already used nearly everywhere in Blender).
2019-05-17UI: add tool panel for node editor, use tabsCampbell Barton
This follows the 3D view, adding an "Options" tab.
2019-05-15UI: make sidebars in 3D view and other editors a little wider and consistentBrecht Van Lommel
2019-04-24Refactor: allow event handlers to have a poll functionJacques Lucke
Previously only a fixed bounding box could be used. This was not flexible enough. T63193 will benefit from this refactor. Reviewers: brecht, campbellbarton
2019-04-18Cleanup: unused region init functionsCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-03-26Cleanup: style, use braces for editor/spacesCampbell Barton
2019-03-17UI: add light/world settings in shader node editor.Brecht Van Lommel
Material was already there. Implementation was changed so it's just a single line of code to adapt a panel to the node editor.
2019-02-27Cleanup: file rename lamp -> lightCampbell Barton
2019-02-27DNA: rename Lamp -> LightCampbell Barton
- BKE_lamp -> BKE_light - Main.lamp -> light
2019-02-20WM: support dynamic keymap handlersCampbell Barton
Add getter callback support for 'WM_HANDLER_TYPE_KEYMAP' type handlers this is needed for key-maps which change based on the active tool. Replaces 'sneaky_handler' hack which temporarily inserted a handler.
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-15Cleanup: comment line length (editors)Campbell Barton
Prevents clang-format wrapping text before comments.