Skip to content

Conversation

andybak
Copy link
Contributor

@andybak andybak commented May 29, 2025

No description provided.

andybak and others added 30 commits March 29, 2021 15:23
This change adds a new folder into the Open Brush user folder called
'Brushes'. The user can add a subfolder with some files in to create a
new brush.

Currently the files needed are:

Brush.cfg - a JSON file with Name, Guid, and VariantOf
icon.png/jpg

Also supported are:
main.png/jpg
normal.png.jpg
Flag VARIANT_BRUSHES turns off brush panel atlasing.
This is so that we can use AtomicWriter for other files int the future.
This updates the metadata schema version to 3.

The schema now has a FallbackBrushIndex guid array that stores the guid
of the built-in brush that should be used if the requested brush cannot
be found.

In the case the brush can't be found, a new brush descriptor is created
by duplicating the descriptor of the fallback brush and changing its
guid to match the missing brush. In this way the scene can be saved out
again without the strokes of the missing brush being affected.
Currently the entire brush source data is being saved on load. I'm not
sure if we want to keep it this way, but it works for the time being.
Does not yet work with Google Drive and Poly sketches.
Also there is nothing to cope with brushes that are duplicated in
sketches and in the brushes directory.

I'm not happy with the weird split between FileOrZip and AtomicWriter,
but it works for now. Some more thought required, perhaps.
FileOrZip was misnamed! A zip *is* a file!
Brushes that are loaded with a scene will only get retained while that
scene is open. trashing a scene or loading a new one will drop them.

If a dropped brush is selected at the time it is dropped, it will be
switched with the default brush.
Almost all fields from brush Descriptor can now be set on
UserVariantBrush from Brush.cfg.
I had overridded Equals, so I needed to override Hashcode as well.
Currently just standard manifest ones.

Does not export Materials yet.
... when exporting brush descriptors.

Also include the exported brush data. This will be used for creating
new user brushes.
Authors can add copy restrictions that determines whether a brush can be
shared or not.
* Changes serialization of copyrestrictions from integer to string
* Uses actual json rather than string manipulation to create brushes.
* Puts default values of the brush into 'Original' subsection.
* Sets the GUID correctly in the exported brushes.
* Sets author of all exported brushes to 'Open Brush'.
* Re-exports all brushes.
# Conflicts:
#	Assets/Prefabs/Panels/LabsPanel.prefab
#	Assets/Resources/Brushes/Basic/Bubbles/Bubbles.shader
#	Assets/Resources/Brushes/Basic/CelVinyl/CelVinyl.shader
#	Assets/Resources/Brushes/Basic/ChromaticWave/ChromaticWave.shader
#	Assets/Resources/Brushes/Basic/Comet/Comet.shader
#	Assets/Resources/Brushes/Basic/DanceFloor/DanceFloor.shader
#	Assets/Resources/Brushes/Basic/Dots/Dots.shader
#	Assets/Resources/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader
#	Assets/Resources/Brushes/Basic/DuctTape/normal.png.meta
#	Assets/Resources/Brushes/Basic/Electricity/Electricity.shader
#	Assets/Resources/Brushes/Basic/Embers/Embers.shader
#	Assets/Resources/Brushes/Basic/Felt/normal.png.meta
#	Assets/Resources/Brushes/Basic/Fire/Fire.shader
#	Assets/Resources/Brushes/Basic/Highlighter/AdditiveCutout.shader
#	Assets/Resources/Brushes/Basic/HyperGrid/HyperGrid.shader
#	Assets/Resources/Brushes/Basic/Hypercolor/normal.png.meta
#	Assets/Resources/Brushes/Basic/Icing/normal.png.meta
#	Assets/Resources/Brushes/Basic/Ink/maintexture_normal.png.meta
#	Assets/Resources/Brushes/Basic/Leaves/normal.png.meta
#	Assets/Resources/Brushes/Basic/OilPaint/normal.png.meta
#	Assets/Resources/Brushes/Basic/Paper/bump.png.meta
#	Assets/Resources/Brushes/Basic/Plasma/Plasma.shader
#	Assets/Resources/Brushes/Basic/Rainbow/Rainbow.shader
#	Assets/Resources/Brushes/Basic/Smoke/Smoke.shader
#	Assets/Resources/Brushes/Basic/Snow/Snow.shader
#	Assets/Resources/Brushes/Basic/SoftHighlighter/SoftHighlighter.shader
#	Assets/Resources/Brushes/Basic/Stars/Stars.shader
#	Assets/Resources/Brushes/Basic/Streamers/Streamers.shader
#	Assets/Resources/Brushes/Basic/ThickPaint/streakystroke_bump.png.meta
#	Assets/Resources/Brushes/Basic/Toon/Toon.shader
#	Assets/Resources/Brushes/Basic/TubeToonInverted/TubeToonInverted.shader
#	Assets/Resources/Brushes/Basic/VelvetInk/VelvetInk.shader
#	Assets/Resources/Brushes/Basic/Waveform/Waveform.shader
#	Assets/Resources/Brushes/Basic/WaveformFFT/WaveformFFT.shader
#	Assets/Resources/Brushes/Basic/WaveformParticles/WaveformParticles.shader
#	Assets/Resources/Brushes/Basic/WaveformTube/WaveformTube.shader
#	Assets/Resources/Brushes/Basic/WetPaint/normal.png.meta
#	Assets/Resources/Brushes/Basic/Wireframe/Wireframe.shader
#	Assets/Resources/Brushes/Shared/Shaders/Additive.shader
#	Assets/Resources/Brushes/Shared/Shaders/Bloom.shader
#	Assets/Resources/Brushes/Shared/Shaders/Multiplicative.shader
#	Assets/Resources/Brushes/Shared/Shaders/Special/Faceted.shader
#	Assets/Resources/Brushes/Shared/Shaders/Unlit.shader
#	Assets/Resources/X/Brushes/Charcoal/normal.png.meta
#	Assets/Resources/X/Brushes/Digital/Digital.shader
#	Assets/Resources/X/Brushes/Drafting/Drafting.shader
#	Assets/Resources/X/Brushes/DryBrush/normal.jpg.meta
#	Assets/Resources/X/Brushes/Fairy/Fairy.shader
#	Assets/Resources/X/Brushes/Fire 2/Fire2.shader
#	Assets/Resources/X/Brushes/Gouache/normal.png.meta
#	Assets/Resources/X/Brushes/Guts/normal.png.meta
#	Assets/Resources/X/Brushes/Lacewing/normal.png.meta
#	Assets/Resources/X/Brushes/MarbledRainbow/normal.png.meta
#	Assets/Resources/X/Brushes/Muscle/muscle_normal.png.meta
#	Assets/Resources/X/Brushes/Race/Race.shader
#	Assets/Resources/X/Brushes/Rain/Rain.shader
#	Assets/Resources/X/Brushes/RisingBubbles/RisingBubbles.shader
#	Assets/Resources/X/Brushes/Slice/Slice.shader
#	Assets/Resources/X/Brushes/Space/Space.shader
#	Assets/Resources/X/Brushes/Sparks/Sparks.shader
#	Assets/Resources/X/Brushes/Square/normal.png.meta
#	Assets/Resources/X/Brushes/TaperedHueShift/TaperedHueShift.shader
#	Assets/Resources/X/Brushes/WatercolorPaper/normal.png.meta
#	Assets/Resources/X/Brushes/Wind/Wind.shader
#	Assets/Shaders/FlatLit.shader
#	Assets/Shaders/Include/Particles.cginc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants