1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 17:49:47 +00:00
Commit graph

459 commits

Author SHA1 Message Date
Variable 42428595c5
Spritesheet Autoslicer (#893)
* Added autoSlicer

* Fixed the remaining things (Autoslicer fully functional)

* Update RegionUnpacker.gd

* Formatting

* formatting

* formatting

* neatify

* Update RegionUnpacker.gd

* formatting

* formatting

* Update RegionUnpacker.gd

* Update README.md

* Added region unpacker class

* Optimized the region unpacker, this should now be twice as fast

addon version: f01526e50db98eea6d4d69db3c241d360887af7f

* change Smart Slicer to 5745b26a6e0b7e10bc4a46d07b5f9f0dd8f26c96

5745b26a6e

* Delete addons/SmartSlicer/Shader directory

* removed shader

* Update SmartSlicer Version

278b1c5a80b2c8b89279e405156d556732ce98d2

* Formatting (This is torture LOL)

2578b74ba84289aa109ae715b4a6c90fd5e23126

* Delete addons/SmartSlicer/addons/SmartSlicer/Classes directory

* Formatting

Version remains same

* Delete SmartSlicePreview.gd

* use _draw instead of line2d

and moved SmartSlicerPreview.gd for better organization

* Formatting

* More formatting

* Fix bugs related to import

* fix crash on attempting to open empty image

as new spritesheet tab (smart)

* removed accidental print

* fix empty image warnings
2023-08-06 14:56:39 +03:00
Emmanouil Papadeas 17fc3d0fcb Support bmp and tga image files in the Web version 2023-08-01 21:16:54 +03:00
Emmanouil Papadeas 996fb17304 Fix error caused by #891 2023-07-31 02:23:03 +03:00
Variable eec986b466
Error elaborator (#891)
* elaborate error messages

* removed accidental change

for some reason godot changes main.tscn gets changed when i open it

* Update Main.tscn

removed accidental change part 2

* formatting

* formatting

* formatting

* lint ignore
2023-07-29 19:19:17 +03:00
Emmanouil Papadeas 19f82021b8 Fix crash on generating a palette from the current project, and non-pixel cels exist 2023-07-09 15:48:49 +03:00
Emmanouil Papadeas 6e46cf0c8d Minor code/scene changes
Renames "Centralize" to "Center", as it is a more appropriate verb.
2023-07-08 17:47:24 +03:00
Variable fa892e1fee
[ExtensionsAPI] New SelectionAPI and more project methods (#885)
* Added more project methods

* Added selection methods

* added resize selection

* formatting

* bug-fix
2023-07-06 02:52:27 +03:00
Variable 26aa9bda38
Move Centralize Image to the frame menu (#884)
* moved centralize to frame menu

And make it effect on selected frames

* Formatting (1 of 2)

* Formatting (2 of 2)
2023-07-05 02:00:36 +03:00
Emmanouil Papadeas a099e2195d Add offset image to Keychain 2023-07-04 14:52:48 +03:00
Emmanouil Papadeas 08064098b8 Add an offset image effect
Some functionality as the move tool, but with more precision, wrap around ability and of course animation.
2023-07-04 03:29:58 +03:00
Emmanouil Papadeas 56f7b9ccde Add a new Timeline category in the Preferences
Revert 21b4f3369f, but make that behavior toggle-able in the Preferences. Also exposes the onion skinning colors for the past and future frames, and renames "Blue-Red Mode" to "Color mode".
2023-07-02 22:18:39 +03:00
Variable 3513ea73e1
Rearrange image menu (#878)
* Update Image menu Enum

* Rearrange Image menu
2023-06-17 00:16:56 +03:00
Emmanouil Papadeas 7ce3bd534a Auto-enlarge the canvas if the imported image is larger than the canvas size 2023-06-16 17:16:32 +03:00
Emmanouil Papadeas 494673e7bc Add export dialog options for including the tag names in the file names, and the ability to change the separator character
The frame number digit count is now 4, so for example exported files are being named as "name_0001.png", "name_0002.png", ... "name_0010.png" and so on. The tag name is now not included in the file name by default.
2023-06-16 04:16:19 +03:00
Emmanouil Papadeas 98cef503c2 Fix various typos 2023-06-15 18:00:29 +03:00
Emmanouil Papadeas 8d5122f54c Release v0.11-stable 2023-06-13 18:05:37 +03:00
Variable 10245ea056
[Targeted for 0.11.0] Export options to extension (#869)
* Added Export Options

* some improvements

* Improvements

* linting

* don't add format if it's already added

* Fix some more bugs

* fixed accidental change

* add accidentally deleted signal
2023-05-27 17:29:53 +03:00
Variable 35e5340bd6
[Targeted for 0.11.0] Additions to ExtensionsAPI (#867)
* clear layer option button before adding new items

* removed some unneeded things and add new things

* Update ExtensionsAPI.gd

* typos
2023-05-23 19:02:34 +03:00
Emmanouil Papadeas 1669cc1a42 [skip ci] Fix some typos in the code 2023-05-18 14:10:15 +03:00
Variable fdb962ba3b
Changes to PanelAPI (#858)
1) Added tab is now set by layout instead of specifying an "alongside_node"
2) Added tab is now shown in the Panels submenu
2023-05-18 13:58:41 +03:00
Emmanouil Papadeas 08996fe6de Add a Cel3DButton scene for 3D cels instead of using PixelCelButton
Mostly to remove the popup menu that appears when you right click a cel
2023-05-09 16:37:32 +03:00
Manolis Papadeas aa47133f9f Emit project_changed and cel_changed signals when opening a project that replaces the old one 2023-05-06 20:31:52 +03:00
Variable 44c2df98e0
Signal api (#851)
* New SignalAPI

* more project methods

* re-order

* Update ExtensionsAPI.gd

* some fixes

* fixes

* more fixes

* Fixes

* typo

* added a required `project_changed`

* Update ExtensionsAPI.gd

* Update ExtensionsAPI.gd
2023-05-01 12:50:15 +03:00
Emmanouil Papadeas 860370bd4e Add a get_class_name() method in the cel classes
I wish Godot had a method for this already
2023-04-30 14:52:01 +03:00
Emmanouil Papadeas 162d0bd2a5 Fix selection tile mode crashing when enabling it 2023-04-28 16:38:14 +03:00
Emmanouil Papadeas 7c14af7129 Add Cel3D in ExtensionsAPI 2023-04-26 10:52:20 +03:00
Emmanouil Papadeas ec2dcae8f7 Add a Posterize image effect, with optional dithering
Seems to produce the same result as GIMP's Posterize color filter. Should be useful for reducing the colors of an image, and it could work together with 3D lighting. Thanks to https://godotshaders.com/shader/color-reduction-and-dither/ for the shader.
2023-04-20 16:08:06 +03:00
Emmanouil Papadeas 1a9691052e Only redraw the second canvas and canvas preview when necessary
Should optimize things ever further. Hopefully I didn't break anything.
2023-04-19 20:51:08 +03:00
Emmanouil Papadeas 1187b0bc49 Load cleanEdge shader when the rotate image or scale image dialog is shown
This should save some time on initial loading, but it introduces a slight loading time when opening the scale or rotate dialog for the first time in a session
2023-04-18 20:08:00 +03:00
Emmanouil Papadeas d04aa5ee56 Add snapping distance slider in the preferences 2023-04-18 17:20:13 +03:00
Emmanouil Papadeas 1325aaa13f Use ValueSliderV2s for grid preferences 2023-04-18 16:38:55 +03:00
Emmanouil Papadeas 1196fb5b0b Use ValueSliders for the canvas zoom and rotation
Should also clean the code a little bit
2023-04-17 02:07:48 +03:00
Emmanouil Papadeas 5c8cf56f8f Make snapping distance change based on the zoom
Should work similarly to GIMP now
2023-04-16 21:15:40 +03:00
Emmanouil Papadeas d68032fbda Fix previous commit to only show the notification once 2023-04-07 02:16:52 +03:00
Emmanouil Papadeas 272ea63615 Only show the "File(s) exported" notification on successful export 2023-04-07 02:09:49 +03:00
Emmanouil Papadeas 91aea32864
Implement 3D layers (#840)
* Implement 3D layers

* Remove unneeded files

* Fix bug where a single hidden layer would ignore all of the layers on top when exporting

* Fix pxo loading

* Remove junk nodes from 3DShapeEdit

Seems like they were created when I copied from the old 3D Options.tscn panel to the new 3D Shape Edit tool.

* Make light gizmos half the size, and hide gizmos when rotating

* Fix crash when using the 3D shape edit tool on a group layer

* Remove unneeded code in Canvas.gd

* Add torus in the Cel3DObject.Type enumerator

Torus isn't currently supported in Godot 3.5, but it is in 3.6 and 4.0, so this is just future-proofing. May break compatibility with .pxo files that were exported with 3D layers before this change.

* Toggle 3D object visibility

* Change texts and some variable names

* Fill translation strings

* Fix crash on group blending, and make the code in Export.blend_layers() more general

* Fix errors when attempting to draw on a 3D cel

Can occur when multiple cels are selected, some of them 3D and some of them pixel

* Make scene properties and objects be per-cel instead of per-layer

Breaks compatibility with previous .pxo files that had 3D layers. Also introduces serialize() and deserialize() methods to BaseCel

* Use if not layer is get_script() in GroupLayer.blend_children()

* Flip the condition in GroupLayer.blend_children()

* Fix bug where locked/invisible layers could get drawn

Regression from c2f6bf0f3f

* Move gizmo code to 3DShapeEdit's draw_start(), move some undo/redo logic to 3DShapeEdit

* Move all of the undo/redo code to 3DShapeEdit, simplify code in Cel3D

* Store Cel3D image data to pxo, for easy usage by external software

This makes importing projects with 3D layers to other software, such as Godot using godot_pixelorama_importer easier.

* Make the linter happy

* Fix bug where the previously selected object would remain selected when it got removed with undo
2023-03-31 21:58:56 +03:00
Emmanouil Papadeas 5c9f0d8c18 Fix bug where, if the bottom-most layer is invisible, selection can't transform content on other layers 2023-03-27 03:42:16 +03:00
Variable ad3a0155b6
Set tilemask automatically (#833)
* AutoCreate Tile Masks

* removed a print()

* Disable masking by default

* changed visibility

* Remove Godot's needless changes in Main.tscn

Godot pls

---------

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2023-03-16 20:07:03 +02:00
mrtripie 0ad86816e5
Crop Tool (#830)
* Added intial crop tool

* [skip ci] Removed unneeeded LINE_WIDTH constant from CropRect

* Added DimensionsLabel

* Cleaned up CropRect._draw

* Hide the CropRect after switching to a different tool

* Sets the crop values to the entire canvas size on setup

* [skip ci] Added crop tool tooltip

* Made Crop tools synced with eachother by placing the crop settings on CropRect

* Added new modes, refactored, added rule of thirds lines and darkened background

* [skip ci] reset optimization

* Renames

* [skip ci] Tweaked the darkened background

* Fixed bug with top/bottom/left/right sliders after rect refactor

* Changing width/height on locked aspect ratio bug

* Aspect ratio sliders rounding/setting a min of 1 px height/width

* Fixed bugs with drawing the crop rect, especially with locked aspect ratio

* Save the mode to config_cache

* Added size lock and renamed mode

* Added tooltip for size lock. Not sure if I did the translation file right

* removed signal that wasn't used

* Formatting

* Removed old TODO comment from one of my previous PRs that isn't true anymore

* Fixed definition order for linter

* Changed locked size modes moving to offset by @Variable-ind, reordered methods

---------

Co-authored-by: MrTriPie <MrTriPie>
2023-03-16 19:50:45 +02:00
Variable e88ba2cb73
Further improvements to Dynamics (#828)
* Image bruch now obeys dynamics as well

* Added a signal that resets dynamics

* formatting

* change uncheck.png

* added preview for pressure

* Added the requested changes
2023-02-28 17:07:48 +02:00
Emmanouil Papadeas c60675b4e7 [WIP] Added dynamics, such as pen pressure (finally!) and mouse velocity affecting alpha and brush size
Alpha currently produces ugly results when drawing on top of opaque colors. See the comment in Draw.gd like 445 for more details.
2023-02-17 15:29:55 +02:00
Emmanouil Papadeas 6f6ff98923 Implement perspective guide snapping 2023-02-12 21:32:35 +02:00
Variable 7307743f83
Added the Perspective editor (#806)
* Added Perspective Editor

* removed unintended changes

* Removed unintended changes

* removed un-intended changes

* Delete Axes.tscn

* Delete Axis.gd

* Removed MouseGuides from editor

I will add them separately

* Added MouseGuides

* Some changes

* Fixed some things

* added mouse guide

* make MouseGuides remember last setting

* don't move if dialog is open

* Dont move tracker guides if dialog is open

* UI improvement to editor

* Update VanishingPoint.gd

* UI Improvement

* Minor Color Improvements

* fixed a bug

This was causing a crash

* Some UI Changes

* Improve UI some more

* fix typo

* Added Undo/Redo and improved UI

* Formatting

* formatting

* formatting

* formatting

* Fix Definition out of order

* Fix Definition out of order

* formatting

* formatting

* fix Duplicate error

* Fix some things

* Some UI Changes

* Some code refinement

* Removed un-needed lines

* Some code refinement

* Some more UI Changes

* Changes, Changes and Changes

* Delete LineButton.gd

* Delete LineButton.tscn

* Delete PerspectiveEditor.gd

* Delete PerspectiveEditor.tscn

* Delete PointCollapseContainer.gd

* Delete PerspectiveLine.tscn

* Delete PerspectiveLine.gd

* Changed boundary separators to ColorRects

* make the guide update more frequently

* make default color have full alpha

* Dim the boundaries based on luminance

* typo

* Formatting

* Formatting

* formatting i forgot to do

* Delete VanishingPoint.gd

* Delete VanishingPoint.tscn

* Fixed rouge collapsible container

---------

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2023-02-12 15:20:53 +02:00
Emmanouil Papadeas a18c7082fa [skip ci] Add SNAP_TO in the ViewMenu enum 2023-02-02 03:45:36 +02:00
Emmanouil Papadeas 8a38eef30d [skip ci] Fix various typos 2023-02-02 03:06:23 +02:00
Emmanouil Papadeas 42d6f12530 Implement rectangular grid and guide snapping
Snap to the rectangular grid and guides (excluding symmetry guides). Can be toggled from the View menu. Currently affects the following tools: Pencil, Eraser, Shading, Line, all shape tool and all selection tools. Although maybe this should not affect the Magic Wand and Select By Color? The snapping distance is currently unaffected by the zoom (should change), and it will be exposed as a parameter in the preferences at a later commit.
2023-01-25 04:37:03 +02:00
Emmanouil Papadeas 7001f3a28b Remove NotificationLabel.tscn, use class_name for notification labels 2023-01-15 17:08:42 +02:00
Emmanouil Papadeas 08e00d3c31 [GLES 3 only] Add OmniScale for scaling and rotation 2023-01-11 17:54:33 +02:00
Emmanouil Papadeas 01fc5cd9bd Fix wrong variable name in ExtensionsAPI 2023-01-10 21:10:05 +02:00
Variable e1facda618
Added Class System to ExtensionsAPI (#808)
* Added Class System to Api

* formatting

* removed extends

* update extension version

* Added Some New Fail-Safes

* fix typo

* Formatting

* Update ExtensionsAPI.gd

* Typo

* formatting

* formatting
2023-01-10 19:26:13 +02:00
Variable 449ee60d49
Folders rearrangement (#804)
* Moved Reference Images to it's Folder

* Moved the rest to their respective folders

* formatting

* Fix formatting

I removed the `PackedScene` static typing declaration to reduce the number of characters in the line to less than 100. It's not really needed anyway, as Godot should be able to figure out that it's a PackedScene, since it's a tscn file, simply by using `:=`.

* reverting some changes

* Removed some un-expected things

* Fixed TransparentChecker Code

* fix typo

* Revert it

I didn't realize it was intended

* Removed unneded changes

* removed some unexpected changes

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2023-01-05 17:54:22 +02:00
Variable d7e33f4431
Api Improvements (#802)
* Api Improvements

Proper Removal of Tools
A new `get_current_cel_info()` method

* a new show_error() method

usefull for displaying messages like "Incompatible API" etc...

* typo

* formatting

* added an improvement
2023-01-04 06:21:15 -08:00
Emmanouil Papadeas ee8d321902 Make cel_changed a Global signal instead
Otherwise we would have to connect the signal for every opened project. If a feature/extension requires it, we could add a reference to the project as a parameter for the cel_changed signal, but since that can get retrieved with Global.current_project, it's probably not needed.
2023-01-03 00:52:23 +02:00
Emmanouil Papadeas 824860a2b5 Add a change_cel() method to Project, instead of using a signal
Using a signal to change the cel was not a good idea, because it was not being emitted with the undo/redo system. The signal should also fire *after* the cel changes, and this is what happens in this commit. Should be useful for future features and extensions to check whether a cel has been changed.
2023-01-02 22:09:47 +02:00
Emmanouil Papadeas 40ab13da35 Add a cel_changed signal in Project to replace _frame_changed and _layer_changed
A small refactor. A very minor performance boost when selecting cels, but also a minor performance decrease when selecting frame buttons. Selecting layer buttons should be pretty much the same. I think the code should be a bit more readable now, plus we got rid of that yield() in Project.gd so that's a bonus.
2023-01-02 18:59:23 +02:00
Emmanouil Papadeas 222e7a1ea8
Implement cleanEdge rotation and scaling (#794)
* Implement clear4x rotation

* Don't use pixelated uvs on the final result, only on the preview, and fix pivot positioning

* Update to cleanEdge algorithm

* Add cleanEdge scaling
2022-12-25 01:11:34 +02:00
20kdc 4658b1cfb6
APNG Loading (#797)
* APNG loader: Import addon to take over APNG handling

* APNG loader: Transition code to using the AImgIO addon

* APNG loader: Can now open APNGs.

* AImgIO: Update to fix bugs

* APNG loader: HTML5

* APNG loader: gdformat/gdlint addon

* APNG loader: OpenSave formatting fix

* APNG Loader: Add ignore line to OpenSave because it's too big

* Fix GIFAnimationExporter bug caused by the switch to the addon
2022-12-23 20:08:46 +02:00
Emmanouil Papadeas 7e15fc9d15 Remove duplicate project-specific variables from Export
Removed `directory_path`, `file_name`, `file_format` and `was_exported` from Export.gd. These variables already exist on Project.gd, no need to have them twice.
2022-12-18 03:33:53 +02:00
Emmanouil Papadeas bf7844b149 Make the notifications always appear on the bottom left of the main canvas 2022-12-16 19:44:40 +02:00
Variable 1df003b2df
Paint selection brush (#792)
* Added the PaintSelect tool

The shortcut keys are not configured

* Some Optimization attempts

* remove typo

* Re-Designed Tool Icon
2022-12-14 18:34:13 +02:00
Emmanouil Papadeas f46c376056 Make reference images work on the Web version*
* Pxos saved with the Web version will have reference images, since their paths will not be stored.
2022-12-07 15:38:44 +02:00
Emmanouil Papadeas 5e90b740e7 Only popup a single files dialog for multiple files - implements #585
This replaces the previous behavior, which used to popup multiple dialogs for each existing file, making the users click "OK" for each exported image.
2022-12-02 02:11:23 +02:00
Emmanouil Papadeas 4989e3e33a Fix Global not being able to find the Reference Images panel 2022-12-02 01:15:49 +02:00
Emmanouil Papadeas a6a1b4da99 Move making GLES2 the default driver in override.cfg outside of Global_init()
This way, override.cfg will not get automatically created when the app opens, unless the user explicitly changes the renderer, or the tablet driver.
2022-12-01 20:17:03 +02:00
Manolis Papadeas fc5497861a Fix tablet driver not reflecting the currently chosen driver
If winink was chosen, the preferences still showed wintab.
2022-11-30 02:09:06 +02:00
Emmanouil Papadeas 0db574c769 Expose tablet driver to the preferences [Windows only] 2022-11-29 21:10:49 +02:00
Emmanouil Papadeas 78f9cb57bb Set GLES2 as the default video driver in override.cfg
Should fix the renderer not being able to get set to GLES3
2022-11-29 20:48:36 +02:00
Emmanouil Papadeas 3ef73eacea Expose GLES driver to the preferences
Users can now change from GLES2 to GLES3 and vice versa. The change requires a restart of Pixelorama to take effect. Does not have any effect if Pixelorama is being run from the Godot editor. I suppose we should add logic that detects if GLES3 is even supported in the first place in that device before allowing it as an option, but at least I enabled GLES2 fallback in the project settings, so it *should* fall back to GLES2.
2022-11-29 19:58:24 +02:00
Emmanouil Papadeas 4d113d37e5
Export dialog UX overhaul (#781)
* Remove animation tab from the export dialog, unify it with the first tab

* Tidy up the UI using GridContainers

* Make ExportDialog a ConfirmationDialog and clean some code

* Make project a parameter in export methods

This will be useful in the future for exporting multiple projects at once via terminal arguments

* Add a layers option in the export dialog

Currently only visible layers and selected layers, need to add specific layer selection and handle group blending properly.

* Align everything to the left

* Change "directory" into "folder"

* Make animation direction affect spritesheets and multiple png exporting

Besides just gifs and apngs

* Minor code re-organization

* Keep spritesheet options when changing tab

* Use the Unicode multiplication sign in the dimension label

* Specific layer exporting with group blending support

* Change file format cursor mode to pointing hand instead of forbidden

* Add a new custom CollapsibleContainer node and use it for advanced settings in the export dialog

* Change Popups node into Control so its children will automatically inherit the theme

* Add the TextureRect of the CollapsibleContainer in the UIButtons group

* Update ExportDialog.gd

* Disable "Create new folder for each frame tag" when gif/apng is selected, and hide it completely on the spritesheet tab

* Fix "Create new folder for each frame tag" being visible even if the CollapsibleContainer's button is not pressed

* Show layer path for each layer in the export dialog's "Layers" option

* Update translations

* Update strings
2022-11-28 21:22:29 +02:00
20kdc 20bce8175c
Reference Images (#771)
* Reference Images: Part 1

* Reference Images: Proper import workflow

* Reference Images: gdformat/gdlint checks

* Reference Images: Remove random src/Main.tscn changes

* Reference Images: Switch to ValueSliders, autowraps, fix opacity going out of range
2022-11-08 20:04:41 +02:00
20kdc 82acf3f8b1
APNG Exporter (#772)
* APNG: Initial refactorings of animation exporter internals

* APNG: Make ExportDialog actually able to handle multiple file formats

* APNG: Bugfix to FPS hint and such

* APNG: Refactoring: Fix file format propagation

* APNG: Make an "APNG exporter" which creates an empty PNG container

This was the testbed of the previous integration commits.

* APNG: The actual exporter!

* APNG: Remove random src/Main.tscn changes

* APNG: Format/lint

* APNG: Format & Lint, part II
2022-10-31 00:24:24 +02:00
Emmanouil Papadeas 7768bc92dd Change OpenSave.handle_loading_file to handle a single path
OpenSave.handle_loading_files() has been renamed to OpenSave.handle_loading_file and it now takes a single string as a parameter, instead of a PoolStringArray. This was needed for Main.gd's new _handle_cmdline_arguments() method. This method does not add any new functionality for now, but it will in the future.
2022-10-23 02:22:26 +03:00
mrtripie e8281bf056
Animation Timeline UI Improvements (#769)
* Fixed link cel indicator color and animation tags position

* New scrolling and min size

* fixed dockable container for the timeline min size

* Cleanup

* Tweaked minimum size

* Removed some hacks that are no longer needed

* Fixed frame scrollbar not being in the right place at startup, added ensure_control_visible

* frame scroll horziontally without shift if can't scroll vertically + min size tweaks

* Renamed the frames/layer/cel containers

* Always scroll by whole frames

* Fixed conflict

* reoranized AnimationTimeline scene's node tree to wrok as expected

* tweaks

* Fixed tag position and removed uneeded layer button theme code

* added the icon theme code back, I thought this was for the timeline XD

* Smaller LayerButtons

* Save Layer and Cel size between sessions

* Combined _on_AddLayer_pressed and _on_AddGroup_pressed into 1 add_layer method

* Rename scroll container

* formatting

Co-authored-by: MrTriPie <MrTriPie>
2022-10-21 16:04:26 +03:00
mrtripie eb153d11a1
Keep colors on cel link sets (#766)
* Implemented except for clone layer bug

* more asserts

* Fixed the layer cloning bug

* gdformat

* Fixed new cels linked crash

* Fixed old .pxo files

* Removed default red color from LinkedIndicator in PixelCelButton scene

Co-authored-by: MrTriPie <MrTriPie>
2022-10-18 03:02:18 +03:00
Emmanouil Papadeas 82d63bd2e8 Fix crash when importing pxos older than v0.7 2022-10-17 03:18:05 +03:00
mrtripie 0faacafb16
Fix id_map error on open_pxo_file as well as grid being wrong size (#765)
Co-authored-by: MrTriPie <MrTriPie>
2022-10-17 02:21:28 +03:00
mrtripie 637662dee4
Linked Cel Refactor and Timeline Refactor Tweaks (#764)
* Updated PixelLayerButton's LinkButton's hint_tooltip to be more accurate

* Don't automatically link the current frame's cel when enabling new_cels_linked on a layer

* Mostly added new system

* renamed link group to link set

* Enable drag and drop of linked cels on the same layer

* formatted CelButton.gd

* serialize/deserialize

* Copy frames w/ new linked cels system. Removed copy_cel from layer classes

* Removed commented out code from AnimationTimeline.copy_frames

* Removed Project.duplicate_layers

* Removed unlink_cel in favour of using null with link cel (as the first part of that method was the same)

* Disabled show_behind_parent on PixelCelButton's LinkedIndicator, as it wasn't enough to improve visibility of selection

* Moved BaseLayer.copy out of the Methods to Override section

* Added optional texture param to Cel's set_content method (needed for use when deserializing, and otherwise helpful

* set textures with set_content where needed

* open_image_as_spritesheet_layer new_cels_linked part updated

* clone layer with linked cels implemented. Removed copy_all_cels from layer classes

* weaked how copied layers names are updated

* Merge layers works with new linked cels now

* Fixed texture on cel buttons not being updated on button setup

* fixed bug where using set_content with new image texture would result in an empty texture

* Open old .pxo with new linked cels

* simplified backwards compatiblity

* removed linked_cels

* better linked cels backwards compatibility

* Removed some old TODO comments

* fixed linked_cels conversion bug when linked_cels is empty

* Added undo for linking the previous cel when creating new cels with new_cels_linked enabled

* Removed TODOs

* Cleaned up some method variable naming

* Cleaned up deserialization

* combined matching for loops

* Inlined BaseLayer.copy() where its used

* gdformat

* Fixed Translations,pot

Co-authored-by: MrTriPie <MrTriPie>
2022-10-16 17:44:01 +03:00
Emmanouil Papadeas fbe6ea9a97 Prevent data loss if the app crashes during save - Fix #763
When saving a pxo and a file of the same name already exists, the new file gets a temporary name (.pxo1 extension), and it gets renamed to its proper name if it's saved successfully (Pixelorama doesn't crash)
2022-10-07 02:16:15 +03:00
Emmanouil Papadeas 59bc9f022d Replace opacity sliders with the new ValueSlider 2022-09-30 01:03:38 +03:00
Emmanouil Papadeas cc332c6cbf Only activate the right tool if action is pressed
Previously it was possible to hold the right mouse button while the left was being held, then release the left and once the right button is released, the right tool would get activated. This commit ensures that the right tool gets activated only on first press of the right mouse button, if the left isn't already activated.
2022-09-29 01:35:12 +03:00
mrtripie 1fa34d7196
Basic Layer Groups and Timeline Refactor (#698)
* Fixed issues with Shading tool Saturation and Value not always being right in Hue Shading mode

* Shading tool hue shifting fixes and tweaks

* Bringing over changes from layer groups brach, without any changes to layer blending

* Some quick fixes to make it work again

* Fixed some of the places where GroupLayers cause errors. Cel Buttons are now hidden when groups are collapsed

* Layer drag highlighting (need to actually drop them correctly, also need to do cels)

* Added more layer hierarchy related functions, organized the function order in the Layer classes a bit

* Switched the layer type changing from string to int

* Moved layer type enum to Global

* Added get_layer_type_name(), currently used for the default layer name

* Renamed the layer get_children/is_a_parent_of functions

* changed get_layer_type_name() to get_default_name(number)

* New layer drag and dropping behavior

* Added read/write_image_data_from/to_pxo functions to Cel classes to handle saving/loading the binary image data for each cel type

* Fixed warning

* Added a line to child layers wich makes it easier to see where they are in the hierarchy

* Fixed debugger warning

* Fixed all cel types loading as PixelCels

* Fixed spacing issue with cels when collapsing groups

* Fixed bug when dropping a child layer to the bottom region of its parent group, where it would end up to far down (maybe disappearing)

* updated temporary todo comments

* Created a base scene for layer buttons and merged layer button script into one

* Prevent the case of parenting to itself in layer drag and drop, fixed static reference to LayerButton still being BaseLayerButton

* Use a base scene for CelButtons

* First bit of the refactoring work

* Several bits of refactoring

* Fixed moving cels

* Cleaned up Project.move_cel function

* Fixed project_layer_removed

* Updated change_frame_order on FrameButton. Some (not all) work on getting the layer UI updated when pressing buttons such as collapse/visible/lock

* Bug fixes. Updating layer button's buttons

* Fixed timeline selection issues when creating a new project. Some code cleanup

* tweaks

* Removed a bunch of commented out code

* Removing more commented out code

* Fixed bugs with timeline selectio. Fixed cels being placed in the reverse layer order when adding a frame

* Changed add/remove_frame to add/remove_frames (multiple support)

* Refactored copy_frames in animation timeline

* added copy function to cel classes

* added layer copy function

* simplifed copy_frames a tiny bit

* Updated TODO comments to categorize them and remove any that were already done

* Turned Project.add/remove_layer into Project.add/remove_layers (multiple support), not yet tested

* Seperated the layer cloning functionality in timeline's add_layer to its own function, since they're only used by one button, renamed to _on_Button_pressed naming scheme, added children support to the delete layer button

* some TODOs

* Added layer swapping

* Added priorities to refactor TODOs

* Simplified layer swapping code a little

* Fixed performance regression on changing project, updated TODOs

* Included _on_MergeDownLayer_pressed in timeline refactor

* Cleaned up _on_MergeDownLayer_pressed refactor

* If all frames are selected, prevent being able to remove all of them

* Fixed cel linking when cloning layers/frames. Moved the copy function from cel classes to layer classes, splitting into copy_cel and copy_all_cels

* Combined and rewrote the 2 project _toggle_layer_buttons_.. functions into 1 simpler _toggle_layer_buttons function

* Simplified _toggle_layer_buttons some more

* Added hierarchy support for move up/down layer buttons

* Added toggle_frame_buttons method to project (extracted from  _frame_changed). Called from main when setting up startup project. Removed _ from start of _toggle_layer_buttons name

* Fixed duplicate_layers parent references being to the original layers

* cleaned up project.move_layers method a bit

* TODOs

* moved the transform_content_confirm calls for the layer buttons in AnimationTimeline (Add/remove/clone) to the project layer modification functions

* animation first/last_frame tweaks and un-press play buttons when the first/last_frame are the same in _on_AnimationTimer_timeout in AnimationTimeline

* Cleaned up project_changed in ANimationTimeline a bit

* Cleaned up project_layer_added in AnimationTimeline

* Changed Layer classes get_default_name to set_name_to_default

* Cleaned up LayerButton.drop_data slightly

* Looked at some of my TODOs

* cleaned up copying cels

* Fixed CelButton linked_indicator not showing up right away when becoming linked

* Cleand up link/unlink cel menu option a little. Fixed situatoin where trying to call button_setup on cel_button that doesn't exist anymore due to undo/redo

* Fixed regression with copy_cel (linked) in when cloning a frame

* Minor cleanup, more detailed comments, updated TODOs

* more improved comments

* Made focus_mode on Cel/Layer/FrameButton NONE to fix bug where it looks like one is selected after pressing it and adding a new Layer/Frame (but its just in the focus state, not the pressed state

* Made AnimationTimeline.change_layer_order work a little more consistantly with LayerButton.drop_data, and fixed a minor bug in it

* Updated comments and TODOs

* cleanup

* removed some code that should no longer be needed

* updated comment

* removed Project's frames and layers setters _frames_changed and _layers_changed

* Made some 'for x in range(array.size())' just 'for x in array.size()'

* updated comments/TODOs

* Cel content changes intial

* Added 'content' methods to Cel classes

* Removed image var from PixelCelButton

* Reusing PixelCelButton.gd on GroupCelButton scene

* Renamed PixelCelButton.gd to CelButton.gd (as it will be used for all Cel Buttons) and deleted GroupCelButton.gd

* Hide the TransparentChecker on GroupCelButton.tscn until a preview texture is added for GroupCels

* TODOs, prevent memory leak when closing projects

* Link/unlink cel cleanup
:

* Added _project param to _init methods of Layer classes

* Added update_texture method to Cel classes (moving part from the update_texture and update_selected_cels_textures methods from Canvas.gd

* Removed a temporary check (which also fixed another bug)

* Clone child layers when cloning a layer

* Added temp dummy get_image method to GroupCel, and use get_image when copying or picking colors

* TODOs

* Made open_image_as_spritesheet_layer work after the timeline refactor (still doesn't work with groups yet though). TODO comment updates

* Added create_new_cel methods to Layer classes

* Updated TODOs and comments

* Renamed Layer class's create_empty_cel to new_empty_cel to match Project's new_emtpy_frame

* Renamed create_layer/cel_button to instantiate_layer/cel_button

* updated TODOs

* prioritized TODOs

* Fixed some warnings

* removed commented out code from previous commit

* Fixed export

* Made open_image_as_new_frame work after timeline refactor

* Fixed open_image_as_new_layer after timeline refactor

* Some linked cel fixes

* More linked cels fixes

* cleanup

* Optimized importing spreadsheet as new layer

* Fixed Scale Image crash with Groups

* Fixed onion skin with groups

* Removed blend_mode from BaseLayer for now

* Mostly fixed image effects

* Fixed resize canvas

* Fixed drag and drop not working with Cel Buttons on Group Layers

* updated TODOs

* Renamed Replace Frame (in open image) to Replace Cel

* Continued renaming Replace Frame to Replace Cel

* Made open_image_at_cels work after timeline refactor

* Added get_layer_path method to BaseLayer

* Replaced AtLayerSpinbox with AtLayerOption for Open Image as New Frame or Replace Cel

* Updated TODOs

* updated TODOs

* Comments for cel content methods

* fixed right clicking group cel button deselecting the button (even though cel is still selected

* frame/layer modification methods comments

* Removed unneeded size flags

* TODO updates

* Removed a loop that would never run from open_image_as_spritesheet_tab

* TODO update

* Combined BaseLayer.get_children_direct and get_children_recursive into a single get_children method with a bool for recursive. Added a get_child_count method

* Removed unneeded frame paramaters from _on_DeleteFrame_pressed and _on_CopyFrame_pressed

* TODO Updates

* Removed unneeded code from delete_frames

* Made delete_frames variable names more consistent with my other changes

* Continuation

* made variable names in copy_frames more consistent with rest of changes

* Update TODOs

* Removed TODOs for after this PR (moved to my notes)

* Fixed crash when pasting image on Group

* Fixed layer .visible check to be is_visible_in_hierarchy()

* Removed some drag highlight polish code that didn't work

* Removed code from Canvas update_texture and update_selected_cels_textures that was redundant

* gdformat

* gdformat

* gdlint fixes

* Fixed Cel button not having its linked indicator show when enabling new cels linked on a layer other than the current layer

* Fixed crop image and centralize image

* Added '# gdlint: ignore=max-public-methods' to the top of Project'

* Fixed dragging cels to layer of different type crash

* Formatted CelButton.gd

Co-authored-by: MrTriPie <MrTriPie>
2022-09-28 21:59:49 +03:00
Variable 56a113d36d
fix recent projects (#755) 2022-09-20 21:14:42 +03:00
Variable 03813b41c5
Remember last choice in import options (#754)
* Remember last choice in import options

Implements 2nd point of  "Minor UX improvements #735"

* formatting
2022-09-20 20:28:35 +03:00
Emmanouil Papadeas a64f102b9a Change paste placement behavior
Paste now places the pasted content in the middle of the canvas view, instead of its original position. A new option in the Edit menu has been added, "Paste in Place", that preserves the previous behavior. This is similar to how GIMP works.
2022-09-15 00:08:22 +03:00
Emmanouil Papadeas 7558c2c891 Add an ExtensionsAPI version
This lets us keep track of changes in the Extensions API easier.
2022-09-14 01:16:39 +03:00
Variable 4b4b0773ff
Highlight color in palette if it's selected in color slots (#730)
* select pallete color (if present)

* find and select color

* [skip ci] Update CHANGELOG.md

Co-authored-by: Emmanouil Papadeas <manoschool@yahoo.gr>
Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2022-09-12 02:03:14 +03:00
Emmanouil Papadeas 66857f5e62 Make background around canvas configurable - implements #586 2022-09-10 02:58:13 +03:00
Emmanouil Papadeas d34e69579f Make circle brushes scale properly, with support for even-numebered diameters
Also reverts commit 488cf0cc93
2022-09-09 00:10:34 +03:00
Emmanouil Papadeas dee49b61bf Move get_ellipse_points() to DrawingAlgos
The same ellipse algorithm will be used for the circular brushes, as I can't seem to make the current circle algorithm work with even-numbered diameters.
2022-09-08 17:35:00 +03:00
Emmanouil Papadeas b9f0f0a647 Move left and right cursor sprite nodes to Main.gd 2022-08-24 14:22:40 +03:00
Emmanouil Papadeas 615491052a Minor code cleanup to reduce lines of code 2022-08-21 00:18:33 +03:00
Emmanouil Papadeas 8a8e6929b9 Replace Tweens with SceneTreeTweens
Futureproofing for easier porting to Godot 4.0, and reducing lines of code in the process ;)
2022-08-09 03:57:14 +03:00
Variable 8a6e393d69
New theme-related methods to ExtensionsAPI (#733)
* hide accidentally visible dialog

* added new theme methods

* Wait for themes to add from api

* remove `find_theme`

* revert last commit

* Formatting

* Some code changes

* update to godot 3.5
2022-08-08 16:20:42 +03:00
Emmanouil Papadeas 41ccc704c2
Refactor the selection system to use an Image instead of a BitMap (#710)
* Use Image instead of BitMap for selection

Not complete and Pixelorama is currently broken

* Add a SelectionMap class

* Make the changes in Selection.gd

* Remove selection_bitmap

* Replace duplicate() with copy_from()

* Fix selection

Intersection and transforming are not working

* Fix wrong pixel color values

* Fix selection transforming

* Call selection_bitmap_changed() on scale

* Fix clipboard

* Remove bitmap_to_image()

* Rename selection_image to selection_map

* No errors in Magic Wand

* Rename selection_bitmap_changed() to selection_map_changed()

* Format

* Fix selection resizing

* Remove a line from image effects

* Fast selection inverting using shader

* Update SelectionMap.gd

* Format

* Convert SelectionMap back to LA8 after inverting

* Minor refactor in RectSelect.gd

* Fix intersections

* Use shader for ColorSelect and add color similarity option

* Update RotateImage.gd
2022-08-08 03:03:17 +03:00
Variable 8803acd105
Tile mode fixes (Heavy testing required) (#723)
* Hide/Show options based on current tile option

* Changed a condition for tile mode

* Simplified tile detection code

* Priortize main tile as nearest if mouse is in it

* make tile mode draw behind canvas

* Changed a condition

* Tiles on top gets detected first...

...in case of overlap

* Only display relavant options

according to current mode

* Update preview according to..

..current mode

* removed print()

* Added tile masking

* Added tile masking

* Compare mask with project size

only masks with same size as project are accepted

* Formatting

* Added the suggestions

* Some minor modifications

* detect if a mask is loaded or not

* Added tile_mask to project

* Cosmetics

* added path detection

* added option to emit signal instead of loading...

... image directly through OpenSave

* Added a way to load mask for HTML5

* formatting

* formatting

* Formatting

* set proper way for saving tile_mask

* Formatting

* removed whitespace
2022-08-02 18:57:06 +03:00
Emmanouil Papadeas b7e6a183a6 Add dockable container methods to ExtensionsAPI 2022-07-31 16:06:26 +03:00
Emmanouil Papadeas c5e2e1ce4c Change badly named variable in ExtensionsAPI 2022-07-29 20:51:45 +03:00
Emmanouil Papadeas acebbdf031 Update ExtensionsAPI.gd 2022-07-29 20:41:39 +03:00
Emmanouil Papadeas c9e5c97214 Fix wrong order of undoredo properties in open_image_as_spritesheet_layer 2022-07-29 19:23:32 +03:00
Emmanouil Papadeas dcebf894bf Fix crash when importing a spritesheet as a new layer, undoing and then exporting
Thanks to @Variable-ind for the fix.
2022-07-29 17:41:38 +03:00