WIP: Brushstroke Tools: Initial Version #328

Draft
Simon Thommes wants to merge 97 commits from SimonThommes/blender-studio-pipeline:brushstroke_tools-initial-version into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

Package brushstroke tooling developed for the Blender Studio Project Gold production based majorly on Geometry Nodes in a convenient addon to create, manage and edit brushstroke objects.

Principles

  • base implementation of features on technical level should be as generic as reasonably possible
    • proof-of-concept for potential future node-tools workflow
  • allow highly flexible workflow for advanced users, while providing intuitive and simple UX for the average user
  • avoid changes to surface objects (use on linked data)

Progress

Required:

  • initial migration from (WIP) Scribble Buddy repository
  • convert into extension
  • include brushstroke assets in resources
  • use brushstroke node-groups for presets
  • add scatter(/fill) functionality
    • split presets into categories
    • create flow object
    • integrate scattering nodes
  • define context flow object (flag + context)
    • add concept and tracking of flow object
    • context flag in modifier
  • additional context link types (Material, UVMap)
  • Reuse surface object instead of stacking
  • display brushstroke Modifier UI based on context
    • Show sibling context
    • UI for multiple context brushstroke objects
    • detach modifier display from active object (?)
  • handle active context brushstrokes switching
    • active object / selection
    • mode
  • add operators to uilist
    • delete
    • edit
    • duplicate
    • add helper object
    • Select Surface
    • Copy to selected surface objects
    • Copy All to selected surface objects
  • make edit mode node tools available for marking brush flow
  • fix pointer property editing in viewport context
  • basic material style setup
  • expose material properties as part of preset
  • node-group refactor (scope TBD, as modular as possible)
  • deformation handling (+ linked data)
  • validate/mitigate performance penalty of continuous context checks
  • set up parenting relation
  • options to simplify modifier UI by hiding/pinning individual sockets (ability to reset)
  • preferences to include textures/datablocks or link
  • operators to fix mod_info data once out of sync
  • operator to fix render settings
  • write docs

Nice to have:

  • change edit button label depending on context method
  • brushstrokes renaming
  • pie menu for edit mode operators
  • allow no surface context
  • hook up preset system to assets (empty objects, material pointer ?)
  • allow for link workflow
  • allow resource path customization
  • brush stroke style management and customization
  • create new brush style node-groups and push to library based on atlas image
    • potentially customizable atlas layout
  • customizable default naming pattern
  • customizable collection assignment rules
  • estimate fill density
    • hook up to bounding box size via context linking with exponent slider
  • display link enum options based on input type
  • more context link types
  • operators to create and assign flow/break etc. afterwards
  • option to reuse flow object
  • expose material viewport color
  • visibility options in layer stack
  • use project on selection with surface obejct
  • copy settings to selected
  • copy brushstrokes to selected surface
  • context dependent UI based on enum sockets
  • tag brushstrokes object with addon version number

TBD:

  • simplify
    • remove/hide custom draw tool functionality
    • restrict modifier system to brush stroke asset stack
  • brush stroke type based on ID
  • baking utilities
  • more context link types
    • Active Camera Object
    • Random Value
    • Custom
  • apply curves step
  • change fill/draw into enum and base purely on presets
  • fill coloration workflow (flow object/color object/texture/setting/attribute)
  • custom attribute drawing in tool settings

To Fix:

  • rename modifiers
  • image texture path options
  • material assignment messed up when preset is initialized
  • UVmap linking on surface draw method (?)
  • fix use attribute button
  • select active + edit accumulates editing context
  • add deformation modifier on flow curves
  • allow id picking for textures and materials
  • tracking active brushstrokes layer
  • write back preset of active brushstrokes layer, even when node active object
  • nullchecks (e.g. deleted surface obj)
  • missing icon for draw tool
  • missing constraint on flow object
  • keep context all links when writing back to preset
    • copy complete socket info to brushstroke object
  • change use_attribute toggle when brush stroke object isn't active
  • change delete modifier operator when brush stroke object isn't active
  • make make preset work on active context brushstroke if not active object

Nodes

  • refactor and modularize
  • surface vs point flow modes
  • separate meshing node-group (?)
  • propagate additional properties from flow curves
    • size
    • color
    • noise
  • random orientation without flow
  • randomization of general orientation
  • color methods
  • break on surface creases/edges
  • figure out proper normals (alternatively)
  • tangent space back-deformation
Package brushstroke tooling developed for the Blender Studio Project Gold production based majorly on Geometry Nodes in a convenient addon to create, manage and edit brushstroke objects. ### Principles - base implementation of features on technical level should be as generic as reasonably possible - proof-of-concept for potential future node-tools workflow - allow highly flexible workflow for advanced users, while providing intuitive and simple UX for the average user - avoid changes to surface objects (use on linked data) --- ### Progress #### Required: - [x] initial migration from (WIP) [Scribble Buddy repository](https://projects.blender.org/SimonThommes/scribble-buddy) - [x] convert into extension - [x] include brushstroke assets in resources - [x] use brushstroke node-groups for presets - [x] add scatter(/fill) functionality - [x] split presets into categories - [x] create flow object - [x] integrate scattering nodes - [x] define context flow object (flag + context) - [x] add concept and tracking of flow object - [x] context flag in modifier - [x] additional context link types (Material, UVMap) - [x] Reuse surface object instead of stacking - [x] display brushstroke Modifier UI based on context - [x] Show sibling context - [x] UI for multiple context brushstroke objects - [x] detach modifier display from active object (?) - [x] handle active context brushstrokes switching - [x] active object / selection - [x] mode - [ ] add operators to uilist - [x] delete - [x] edit - [x] duplicate - [ ] add helper object - [x] Select Surface - [ ] Copy to selected surface objects - [ ] Copy All to selected surface objects - [x] make edit mode node tools available for marking brush flow - [x] fix pointer property editing in viewport context - [x] basic material style setup - [x] expose material properties as part of preset - [ ] node-group refactor (scope TBD, as modular as possible) - [ ] deformation handling (+ linked data) - [ ] validate/mitigate performance penalty of continuous context checks - [x] set up parenting relation - [x] options to simplify modifier UI by hiding/pinning individual sockets (ability to reset) - [ ] preferences to include textures/datablocks or link - [ ] operators to fix mod_info data once out of sync - [ ] operator to fix render settings - [ ] write docs #### Nice to have: - [x] change edit button label depending on context method - [x] brushstrokes renaming - [x] pie menu for edit mode operators - [ ] allow no surface context - [ ] hook up preset system to assets (empty objects, material pointer ?) - [ ] allow for link workflow - [ ] allow resource path customization - [ ] brush stroke style management and customization - [ ] create new brush style node-groups and push to library based on atlas image - [ ] potentially customizable atlas layout - [ ] customizable default naming pattern - [ ] customizable collection assignment rules - [x] estimate fill density - [ ] ~~hook up to bounding box size via context linking with exponent slider~~ - [ ] display link enum options based on input type - [x] more context link types - [ ] operators to create and assign flow/break etc. afterwards - [x] option to reuse flow object - [ ] expose material viewport color - [x] visibility options in layer stack - [x] use `project on selection` with surface obejct - [ ] copy settings to selected - [ ] copy brushstrokes to selected surface - [x] context dependent UI based on enum sockets - [x] tag brushstrokes object with addon version number #### TBD: - [ ] simplify - [ ] remove/hide custom draw tool functionality - [ ] restrict modifier system to brush stroke asset stack - [ ] brush stroke type based on ID - [ ] baking utilities - [ ] more context link types - [ ] Active Camera Object - [x] Random Value - [ ] Custom - [ ] apply curves step - [ ] change fill/draw into enum and base purely on presets - [ ] fill coloration workflow (flow object/color object/texture/setting/attribute) - [ ] custom attribute drawing in tool settings #### To Fix: - [x] rename modifiers - [ ] image texture path options - [ ] material assignment messed up when preset is initialized - [ ] UVmap linking on surface draw method (?) - [x] fix use attribute button - [ ] select active + edit accumulates editing context - [ ] add deformation modifier on flow curves - [x] allow id picking for textures and materials - [x] tracking active brushstrokes layer - [ ] write back preset of active brushstrokes layer, even when node active object - [ ] nullchecks (e.g. deleted surface obj) - [ ] missing icon for draw tool - [x] missing constraint on flow object - [ ] keep context all links when writing back to preset - [ ] copy complete socket info to brushstroke object - [ ] change `use_attribute` toggle when brush stroke object isn't active - [ ] change delete modifier operator when brush stroke object isn't active - [ ] make `make preset` work on active context brushstroke if not active object --- ### Nodes - [ ] refactor and modularize - [ ] surface vs point flow modes - [ ] separate meshing node-group (?) - [ ] propagate additional properties from flow curves - [ ] size - [x] color - [ ] noise - [ ] random orientation without flow - [ ] randomization of general orientation - [x] color methods - [ ] break on surface creases/edges - [x] figure out proper normals (alternatively) - [ ] tangent space back-deformation
Simon Thommes added 1 commit 2024-08-21 14:55:20 +02:00
- initial migration from (WIP) Scribble Buddy repository (https://projects.blender.org/SimonThommes/scribble-buddy)
- convert into extension
Simon Thommes added 1 commit 2024-08-21 15:20:37 +02:00
Simon Thommes added 3 commits 2024-08-21 16:21:47 +02:00
Simon Thommes added 2 commits 2024-08-21 18:53:48 +02:00
Simon Thommes added 1 commit 2024-08-22 14:49:50 +02:00
Simon Thommes added 3 commits 2024-08-22 17:27:08 +02:00
Simon Thommes added 2 commits 2024-08-22 18:52:57 +02:00
- include initial brushstroke material
- add initial brush atlas library
Simon Thommes added 3 commits 2024-08-22 19:30:10 +02:00
Simon Thommes added 2 commits 2024-08-23 16:21:59 +02:00
Simon Thommes added 1 commit 2024-08-23 17:53:00 +02:00
Simon Thommes added 3 commits 2024-08-23 18:58:14 +02:00
Simon Thommes added 2 commits 2024-08-23 19:11:19 +02:00
Simon Thommes added 1 commit 2024-08-23 19:25:36 +02:00
Simon Thommes changed title from Brushstroke Tools: Initial Version to WIP: Brushstroke Tools: Initial Version 2024-08-26 12:15:43 +02:00
Simon Thommes added 3 commits 2024-08-26 12:41:47 +02:00
Simon Thommes added 1 commit 2024-08-26 12:51:06 +02:00
Jacques Lucke reviewed 2024-08-26 12:52:27 +02:00
Jacques Lucke left a comment
First-time contributor

Was just reading this because I was curious, left some general code style comments. Maybe that's useful.

Was just reading this because I was curious, left some general code style comments. Maybe that's useful.
@ -0,0 +7,4 @@
m.register()
def unregister():
for m in modules:
First-time contributor

Generally it's recommended to unregister in reverse registration order: for m in reversed(modules):

Generally it's recommended to unregister in reverse registration order: `for m in reversed(modules):`
SimonThommes marked this conversation as resolved
@ -0,0 +202,4 @@
mod_info = settings.preset_object.modifier_info.add()
mod_info.name = mod.name
utils.mark_socket_context_type(mod_info, 'Socket_2', 'SURFACE_OBJECT')
First-time contributor

It's not really necessary to have empty return statements.

It's not really necessary to have empty return statements.
SimonThommes marked this conversation as resolved
@ -0,0 +35,4 @@
if not settings.context_brushstrokes:
return
if len_prev == len(settings.context_brushstrokes):
settings.active_context_brushstrokes_index = idx
First-time contributor

Generally, the code would be easier to read if line lengths were more limited. E.g. for Blender we have a 120 line length limit. That also makes it easier to have two files open next to each other. Such limits can be enforced automatically with auto-formatters like autopep8 (what we currently use in Blender) or e.g. black.

Generally, the code would be easier to read if line lengths were more limited. E.g. for Blender we have a 120 line length limit. That also makes it easier to have two files open next to each other. Such limits can be enforced automatically with auto-formatters like `autopep8` (what we currently use in Blender) or e.g. `black`.
SimonThommes marked this conversation as resolved
@ -0,0 +124,4 @@
return bs['BSBST_surface_object']
def get_flow_object(bs):
if not 'BSBST_flow_object' in bs.keys():
First-time contributor

Would recommend using x not in y instead of not x in y for improved readability.

https://stackoverflow.com/a/3481700

Would recommend using `x not in y` instead of `not x in y` for improved readability. https://stackoverflow.com/a/3481700
SimonThommes marked this conversation as resolved
Simon Thommes added 3 commits 2024-08-26 13:13:08 +02:00
Author
Member

@JacquesLucke thanks for the input! I implemented most of the suggestions

@JacquesLucke thanks for the input! I implemented most of the suggestions
Simon Thommes added 1 commit 2024-08-26 14:19:09 +02:00
Simon Thommes added 2 commits 2024-08-26 17:16:43 +02:00
Simon Thommes added 4 commits 2024-08-27 15:13:02 +02:00
Simon Thommes added 2 commits 2024-08-27 17:00:35 +02:00
Simon Thommes added 1 commit 2024-08-27 17:10:33 +02:00
Simon Thommes added 2 commits 2024-08-27 17:23:05 +02:00
Simon Thommes added 1 commit 2024-08-27 17:49:45 +02:00
Simon Thommes added 1 commit 2024-08-27 18:03:46 +02:00
Simon Thommes added 8 commits 2024-08-28 16:53:29 +02:00
The manual_shot_name prop was being evaluated exclusively (ignoring
shot_name, which is set on shot init). This made it impossible to
submit newly initialized shots unless a manual_shot_name was set.

Now both props are taken into account, and if manual_shot_name is not
set, we show show_name as placeholder.
Take into account the existence of strip.kitsu.shot_name in more
places (currently we were only evaluating manual_shot_name.
Simon Thommes force-pushed brushstroke_tools-initial-version from eeb5453f9c to 88b9de2ab2 2024-08-28 17:29:34 +02:00 Compare
Simon Thommes added 1 commit 2024-08-28 17:42:54 +02:00
Simon Thommes added 2 commits 2024-08-28 19:03:16 +02:00
Simon Thommes added 1 commit 2024-08-29 19:52:00 +02:00
Simon Thommes added 1 commit 2024-08-30 19:05:17 +02:00
Simon Thommes added 2 commits 2024-09-02 11:51:17 +02:00
Simon Thommes added 6 commits 2024-09-02 16:07:57 +02:00
Simon Thommes added 2 commits 2024-09-02 16:53:28 +02:00
Simon Thommes added 1 commit 2024-09-02 18:04:25 +02:00
Simon Thommes added 2 commits 2024-09-02 19:16:31 +02:00
Simon Thommes added 2 commits 2024-09-03 11:01:43 +02:00
Simon Thommes added 1 commit 2024-09-03 13:55:23 +02:00
Simon Thommes added 1 commit 2024-09-04 20:01:00 +02:00
Simon Thommes added 2 commits 2024-09-05 16:58:26 +02:00
Simon Thommes added 1 commit 2024-09-06 14:58:07 +02:00
Simon Thommes added 2 commits 2024-09-06 16:12:45 +02:00
Simon Thommes added 3 commits 2024-09-06 16:29:15 +02:00
Simon Thommes added 2 commits 2024-09-06 18:02:55 +02:00
Simon Thommes added 1 commit 2024-09-10 19:10:38 +02:00
Simon Thommes added 1 commit 2024-09-12 16:58:45 +02:00
Simon Thommes added 1 commit 2024-09-12 17:08:18 +02:00
Simon Thommes added 1 commit 2024-09-12 17:20:11 +02:00
Simon Thommes added 2 commits 2024-09-12 17:45:39 +02:00
Simon Thommes added 1 commit 2024-09-12 18:48:10 +02:00
Simon Thommes added 3 commits 2024-09-13 14:20:51 +02:00
Simon Thommes added 2 commits 2024-09-13 18:23:40 +02:00
Simon Thommes added 2 commits 2024-09-13 19:06:59 +02:00
Simon Thommes added 1 commit 2024-09-13 19:11:17 +02:00
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u brushstroke_tools-initial-version:SimonThommes-brushstroke_tools-initial-version
git checkout SimonThommes-brushstroke_tools-initial-version
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: studio/blender-studio-pipeline#328
No description provided.