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-03-08Speedup for usual non-manifold exact boolean case.Howard Trickey
The commit rB6f63417b500d that made exact boolean work on meshes with holes (like Suzanne) unfortunately dramatically slowed things down on other non-manifold meshes that don't have holes and didn't need the per-triangle insideness test. This adds a hole_tolerant parameter, false by default, that the user can enable to get good results on non-manifold meshes with holes. Using false for this parameter speeds up the time from 90 seconds to 10 seconds on an example with 1.2M triangles.
2021-03-06Cleanup: commentsCampbell Barton
2021-03-05Geometry Nodes: Sort attribute search items when menu opensHans Goudey
Because the search didn't run when the menu first opens, the attributes appeared in a different order than after you typed anything into the search field. This commit instead runs the search when the menu is first opened, but it only sorts items without filtering.
2021-03-05Cleanup: Remove redundant special handling after previous commitJulian Eisel
Not needed anymore since 3a907e742507.
2021-03-05Outliner: Barebones to port IDs to new Outliner tree-element code designJulian Eisel
Continuation of work in 2e221de4ceee and 249e4df110e0 . This prepares things so we can start porting the individual ID types to the new code design. I already added some code for library IDs, because they need some special handling during construction, which I didn't want to break. The `AbstractTreeElement::isExpandValid()` check can be removed once types were ported and can be assumed to have a proper `expand()` implemenation. Also makes `TreeElementGPencilLayer` `final` which I forgot in e0442a955bad.
2021-03-05Fix incorrect assert in Outliner ID deletionJulian Eisel
Mistake in aa3a4973a30f. The expanded `ELEM()` check would include `0 && te->idcode != 0`, which always evaluates to `false`/`0`. That wouldn't cause the asset to fail, but the `te->idcode` part would never be checked. Fixed the error and cleaned up the check against "0" with a check against `TSE_SOME_ID`, see b9e54566e3b1a.
2021-03-05Cleanup: Add & use enum value for ID Outliner element typeJulian Eisel
Code to check if the Outliner tree-element type was the general ID one would always check against "0" (explicity or even implicitly). For somebody unfamiliar with the code this is very confusing. Instead the value should be given a name, e.g. through an enum. Adds `TSE_SOME_ID` as the "default" ID tree-element type. Other types may still represent IDs, as I explained in a comment at the definition. There may also still be cases where the type is checked against "0". I noted in the comment that such cases should be cleaned up if found.
2021-03-05Cleanup: Rename func occurences to _fnSebastián Barschkis
Use _fn as a suffix for callbacks.
2021-03-05Asset Browser Space API: add `activate_asset_by_id()` functionSybren A. Stüvel
Add an RNA function `activate_asset_by_id(asset_id: ID, deferred: bool)` to the File Browser space type, which intended to be used to activate an asset's entry as identified by its `ID *`. Calling it changes the active asset, but only if the given ID can actually be found. The activation can be deferred (by passing `deferred=True`) until the next refresh operation has finished. This is necessary when an asset has just been added, as it will be loaded by the filebrowser in a background job. Reviewed By: Severin Differential Revision: https://developer.blender.org/D10549
2021-03-05UI Code Quality: Port Outliner Grease Pencil layers to new designJulian Eisel
Continuation of work in 2e221de4ceee and 249e4df110e0. Now the tree-element types have to be ported one by one. This is probably the most straight forward type to port.
2021-03-05Cleanup: Sync header+implementaiton definition.Jeroen Bakker
Gave warning on Windows platform. There are more of these cases.
2021-03-05Cleanup: Use boolean in WM_cursor_waitAntonio Vazquez
2021-03-05Cleanup: rename event to event_typeCampbell Barton
Reserve `event` for wmEvent.
2021-03-05Cleanup: spellingCampbell Barton
2021-03-05Cleanup: rename evt to eventCampbell Barton
Following naming convention of most operators.
2021-03-04GPencil: Implement Autokey button for Draw/Edit and Sculpt modeAntonio Vazquez
Now, if the Autokey is not enabled, a new frame is not created and it is used the last active one. If no active frame, a message is displayed and the operation is canceled. This is a common request for 2D artists. Also, grease pencil was not working as Blender does in other areas. Reviewed By: pepeland Differential Revision: https://developer.blender.org/D10557
2021-03-04Cleanup: Main `foreach ID` code: Remove `MAX_LIBARRAY` and improve comments.Bastien Montagne
The `MAX_LIBARRAY` define was an annoying doublon to the `INDEX_ID_MAX` enum value now defined in `DNA_ID.h`, and it is no more useful. And comments were somewhat outdated. Also added an explanation about chosen order for the `INDEX_ID_<IDTYPE>` order.
2021-03-04Fix T86172: tag relations update when pasting nodesJacques Lucke
Pasting nodes can create new id relations, because nodes can reference IDs. Therefore the depsgraph has to be updated when nodes are pasted. We could somehow check if the pasted nodes referenced IDs, but I'm not sure if this complexity is worth it.
2021-03-04Cleanup: redundant struct declarationsCampbell Barton
2021-03-04Cleanup: use non-zero comparisons for event modifiersCampbell Barton
Use event modifier checks that follow most of Blender's code.
2021-03-04Cleanup: use BM_mesh_copy_init_customdata utility functionCampbell Barton
2021-03-04Cleanup: commentsCampbell Barton
2021-03-04Cleanup: use const arraysCampbell Barton
2021-03-04Cleanup: number literalsCampbell Barton
2021-03-04UI: Remove extra blank space for decorators in FCurve modifiersHans Goudey
None of these properties can be animated, so it doesn't make sense to leave space for decorators on the right side of the panels. In fact that is what was intended, but they were not manually disabled in all of the panels.
2021-03-03Geometry Nodes: Allow clearing an attribute text fieldHans Goudey
Because pressing enter will choose the current search item from the menu, and there was no search item with an empty string, it was impossible to clear the text of an attribute text field. This commit adds a simple "X" icon in the top row when you delete the string.
2021-03-03UI: Allow translation for node error messagesHans Goudey
This commit exposes the strings used in the node error messages for localization. It also changes the message tooltip creation to automatically add the period at the end, to be more consistent with the (arguably bad) design of other tooltips in Blender. Calling `TIP_` directly in the node implementation files allows us to continue using `std::string` concatenation instead of passing variadic arguments. It's also more explicit about which part of the message is translated and which isn't. The files already include the translation header anyway.
2021-03-03Cleanup: clang tidyJacques Lucke
Warnings: * readability-inconsistent-declaration-parameter-name * readability-redundant-smartptr-get
2021-03-03Cleanup: clang tidyJacques Lucke
Can use const parameter.
2021-03-03Cleanup: clang tidyJacques Lucke
Warning: else-after-return/break
2021-03-03Cleanup: make formatJacques Lucke
2021-03-03Fix crash when dragging nodesHans Goudey
The `bNodeLinkDrag` struct was NULL when dragging a node instead of a link. It is allocated with `calloc` anyway, so this field doesn't need to be explitely cleared.
2021-03-03Fix T85966: Wrong link picked when dragging multi-input socketFabian Schempp
The socket drag operator stored the index of the last picked socket into RNA in case the mouse cursor leaves the link while dragging. This id was not unique which is why sometimes a link from an other node with the same id is picked. This patch changes the way the last picked link is stored and stores a pointer to the link directly into bNodeLinkDrag struct instead. Differential Revision: https://developer.blender.org/D10590
2021-03-02Cleanup: spelling, minor correctionsCampbell Barton
Also use doxygen comments for sculpt functions.
2021-03-02Python API: Expose CurveMapping Reset View functionPatrick Busch
The Python API for the curve mapping widget offers the `update` function, but no way to reset the view to the clipping rectangle. This commit adds a blenkernel function for this operation, and exposes it to the CurvMapping RNA API. This allows addons to display a more user-friendly view of the data in this widget. Differential Revision: https://developer.blender.org/D10561
2021-03-02Geometry Nodes: Attribute search drop-downHans Goudey
This commit adds a search for existing attributes when you click on an attribute field. This is useful because otherwise you have to remember which attributes should be available at each node in the tree. The fundamental complication is that this information is not accessible statically. So the search data is only a cache from the previous node tree evaluation. The information is added with `BKE_nodetree_attribute_hint_add`, currently for every input geometry socket for a single node. This is only an initial implementation, and later versions will expose the data type and domain of the attributes. Differential Revision: https://developer.blender.org/D10519
2021-03-02UI: Rename search button variableHans Goudey
I landed D10527 in rB1a8aee0a7cec accidentally, and the version there was missing a name change discussed in review. This commit just renames the boolean variable controlling the special behavior for attribute search. Original message meant for this change: For geometry nodes we will use search buttons to display a list of attributes available the last time the node tree was executed (D10519). Because this list is just a hint, we need to be able to enter any string, not just strings from the search items. This patch adds a boolean option to string buttons to enable this. The change is quite simple, changes to behavior are only required in two places. The type-specific button struct changes help a lot here. Differential Revision: https://developer.blender.org/D10527
2021-03-02UI: Clean up labels and descriptions: "Draw" to "Display"William Reynish
In Blender, we used to use the term 'draw' to refer to information displayed to the user. For version 2.80, it was decided to change these instances to 'display' instead. This was to avoid the ambiguity between end-user drawing tools and display options. From the Oxford English Dictionary: - Draw: produce (a picture or diagram) by making lines and marks on paper with a pencil, pen, etc. - Display: show (data or an image) on a computer, television, or other screen. Therefore, we should use draw when referring to drawing tools for making marks, but use display when referring to information shown/displayed to the user. From a user POV, the computer displays certain information, whereas the user draws a mark. Apparently this change was not implemented consistently, so this patch changes all remaining relevant instances of "draw". Differential Revision: https://developer.blender.org/D10551
2021-03-02UI: Expose an "is first search" boolean to search button callbacksHans Goudey
Currently when you open an RNA collection search button, like a vertex group selector, the search filter isn't applied until you start typing, in order to display every option at the start. Otherwise they wouldn't be visible, since the search filter would run for the current text. Currently this check happens in one place, but it relies on the `changed` value of `uiBut`. This is fine in the interface directory, but anywhere else it would require exposing `uiBut.changed`, which is probably too low-level to expose. The solution is adding an `is_first` argument to the search callbacks, which is nice for a few reasons: - They work at a higher level of abstraction, meaning they don't have to worry about how exactly to tell if this is the first search. - It makes it easier to do special behavior when the search menu is first opened. - Then, obviously, it makes that state accessible without including `interface_intern.h`. Needed for attribute search: T85658 Differential Revision: https://developer.blender.org/D10528
2021-03-02Sculpt: Expand OperatorPablo Dobarro
Expand is a new operator for Sculpt Mode which is intended to be the main tool for masking, Face Set editing, interacting with the filters and pattern creation. The fundamentals of the tool are similar to the previous sculpt.mask_expand operator. It shares the same default shortcuts and functionality, making the previous operator obsolete. The shortcuts to execute the operator are: - Shift + A: Expand mask - Shift + Alt + A: Expand mask by normals - Shift + W: Expand Face Set - Shift + Alt + W: Resize current Face Set The main changes compared to the previous sculpt.mask_expand operator are: - Modal keymap, all operator options can be changed in real time while the operator is running. - Supports creating Mask, Face Sets and Sculpt Vertex Colors. - Much better code, new features can be easily integrated. Limitations: - All Mask operations are supported for Sculpt Vertex colors, but not exposed by default as their support is still experimental. - Dyntopo does not support any Face Set or Sculpt Vertex Colors. functionality (they are not implemented in general for Dyntopo). - Multires does not support any feature related to geodesic distances. - Multires does not support vertex colors. - Multires does not support recursions. - In Multires, Face Sets snaping does not initialize all current enabled Face Sets when toggling snapping. - In Multires, Face Sets are created at base mesh level (works by this by design, like any other tool). - Unlike the previous mask_expand operator, this one does not blur the mask by default after finishing Expand as that does not fit the new design. The mask can still be blurred by using the mask filter manually. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10455
2021-03-02Cleanup: remove unused argumentsRichard Antalik
2021-03-02VSE: Refactor meta operatorsRichard Antalik
Move low level logic to module code and versioning logic to versioning code. Metas strip position was handled in diffrent way compared to other strips. This was introduced in c8b0d25794be as bugfix for T28158. I disagree with such design. Meta strips should be handled in same way as any other strips. I have tested this change and haven't found any problems. No problems after checking T28158 as well. There should be no functional changes on user level. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D9972
2021-03-02VSE: Refactor VSE strip loading codeRichard Antalik
Isolate RNA and operator logic from functions that create strips. - Operator specific code was removed from `SeqLoadInfo` structure and `SEQ_add_*` functions. - Strip loading code was removed from RNA and operator functions. - `SEQ_add_*` API was unified to work on `SeqLoadData` struct. Only exception is image strip, which require files to be loaded separately to strip creation itself. This is not ideal, but I think it's acceptable. - Some functions and variables were refactored so the code reads better. There are minor functional changes (coincidental bugfixes): - Operator errors are reported per-strip. Previously they were not reported at all? - `new_sound()` RNA API function now create sound with length of 1 if source file does not exist. Previously it created strip with length of 0. - Replace selection operator property wasn't working correctly. Fixed in this patch. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9760
2021-03-02Geometry Nodes: show "Show Texture in texture tab" buttonPhilipp Oeser
This enables the quick access button [to show the relevant Texture in the Properties Editor] for textures used in geometry nodes. This goes in line to what we do for other textures: - modifier textures have this button - particle textures have this button - brush textures will soon have it, too (see D9813) When outside of the Properties Editor, the button will always show (if a texture is actually assigned), but will be inactive if no suiting Properties Editor to show the texture in can be found. Note this also changes the behavior to not show the button if _no_ texture is assigned (as in: we are still showing the "New" button). Previously it was always there (e.g. for modifier textures), even if it would take us to an empty texture tab. (Sure, we could add a texture there then, but imho it makes more sense to just start showing it once a texture is already there) For this to work with geometry nodes, the following chages were done: - implement foreachTexLink for geonode modifiers - new buttons_texture_user_node_property_add() that stores prop as well as node - also use NODE_ACTIVE_TEXTURE flag in geometry nodetrees notes: - this still uses the first suiting (as in: pinning does not interfere) Properties Editor it finds, this should (maybe?) find the _closest_ Property Editor instead (see related feedback in D9813). - this will already show the button for brush textures as well (disabled), but there is another mandatory change in an upcomming commit to make it work there as well (see D9813) ref. T85278 Maniphest Tasks: T85278 Differential Revision: https://developer.blender.org/D10293
2021-03-01Build-system: Use C-linkage for internal interface headerJulian Eisel
That way the header can be included in C++ files.
2021-03-01Cleanup: move some drawing code into ed_draw.cChristoph Lendenfeld
Move some drawing code from `area.c` and `ed_util.c` into `ed_draw.c`. This is to support the new generic slider that wil be used in T81785. No functional changes. Reviewed By: #animation_rigging, #user_interface, Severin, sybren Maniphest Tasks: T81785 Differential Revision: https://developer.blender.org/D9313
2021-03-01Cleanup: Use LISTBASE_FOREACH and LISTBASE_FOREACH_MUTABLE macroGermano Cavalcante
2021-03-01Work around T86015: Crash undoing in certain scenario (disabling Global Undo).Bastien Montagne
Simply disable advanced 're-use current blend data` process when loading a memfile step and Global Undo is disabled, since there is no way to ensure we have a proper 'differential' state in the stack then. NOTE: this is a quick work-around to fix the crash, not a satisfying solution by far (pretty sure there can still be crashes if you then re-enable Global Undo afterwards e.g.).
2021-02-27Fix T85886: Rotate Tool and Adjust Last Operation - angles invertedGermano Cavalcante
The constraint was not set when redoing. This commit also removes `postInputRotation`. I really couldn't see a use for it.
2021-02-27Fix T85987: Selection when GP is parentedFalk David
When a GP object was parented to e.g. a bone, box selection as well as point selection were broken in that the selection from the user would not correlate with what was actually being selected. The issue was that box and point selection did not use the active evaluated stroke data. The fix uses the correct data. Reviewed By: antoniov Maniphest Tasks: T85987 Differential Revision: https://developer.blender.org/D10555