* 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>
Prevents errors (and potentially unwanted behavior) if attempting to undo while in the middle of drawing with the Pencil, Eraser of Shading tools. Needs more testing in case I broke something else.
* 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>
* 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
* 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
* Add preferences for tile mode basis vectors
Each tile is offset according to the x and y basis. For example, a tile (1,1) would be at basis_x + basis_y
* Update tools for custom tile modes
Show the indicator in the correct position, and only draw on the nearest tile.
* Fix style issues
* Move tile functionality to own class to prevent bloating Project
* Fix error in Tiles bounding box logic
* Make tile mode offsets project settings
Since the desired tile mode offsets depends on the tile being drawn, the tile mode offsets should be a project specific setting which is persisted in the project file.
* Update TileMode object immediately after closing dialog
* Don't draw center tile by default in TileMode
* Move tile mode offsets to view menu
* Move tile mode offsets dialog out of ImageEffects
When exporting an imported image, the export will happen immediately, without having the export dialog appear, unless "Export as..." is selected. For .png imported images, the menu option will display "Overwrite" instead of "Export". This makes it clear that if Control + E is pressed on an imported png, that file will be overwritten.
Instead of LA8. This should result in slightly less memory usage and is more on par with Godot's BitMap "convert_to_image" method, which will be exposed in Godot 3.5.
* Fixed issues with Shading tool Saturation and Value not always being right in Hue Shading mode
* Shading tool hue shifting fixes and tweaks
* Duplicate shader resource before modifying its code
* added line before comment
Co-authored-by: MrTriPie <MrTriPie>
Removed the "frame_container" property from Layer.gd, which used to hold a reference to a node, leading to orphan nodes being created and never freed. Memory management seems to be working okay now. Previously, every time the user made a change, memory kept going up and never coming down. Now, data that can never be recovered, like undo data that have been rewritten in history, are also removed from memory.
Now inherits from ImageEffect and uses a ShaderImageEffect to generate the image. We get to clear duplicate code that was shared between ShaderEffect.gd and ShaderImageEffect.gd this way, and it also uses the undo/redo logic from ImageEffect instead of Canvas.gd.
As a way to differentiate between public and private methods, as per the official GDScript naming convention. Haven't changed all of the codebase yet, just some scripts that had a lot of public methods. This fixed 4 of the 7 errors of the linter.
* gdformat .
* Lint code - Part 1
* Format code - Part 2
* Lint code - Part 2
Trying to fix the max allowed line length errors
* Add normal_map_invert_y to the image .import files
Because of Godot 3.4
* Do not call private methods outside of the script's scope
Lint code - Part 3
* Format code - Part 3
* Fixed more line length exceeded errors - Lint code Part 3
* Export array of licenses - Lint code part 4
* Clean hint_tooltip code from Global
Removes a lot of lines of code
* Create static-checks.yml
* Fix FreeType's license
* Animation tag fix (a)
fixed tag behavior in "Project.gd"
* Animation tag fix (b)
fixed tag behavior in "AnimationTimeline.gd"
* Animation tag fix (c)
fix top part of line not visible
* Animation tag fix (d)
a fix i forgot about earlier
* added a randomizer...
... to auto select colors of new tags
* Fix Tag scrolling without cels when scrolled on it
* removed randomize() cause it's not needed
* Open/Save Sprite Dialogs now have their directory cached so when reopening Pixelorama they will be set to that directory. Load last project and load recent project also syncs with the open/save dialogs and caches that directory
* Sets a projects default file path to the cached file directory (not sure about) and if the export directory is blank, use the cached file directory
* Changed 'file_dialog_dir' to 'current_dir'
Co-authored-by: MrTriPie <MrTriPie>
Not sure if this actually solves the issue or just makes it more rare, but I haven't been able to reproduce any PoolVector locking issues so far. The problem was that images were remained locked essentially all the time, which seemed to cause issues. Maybe other PoolVectors could not get locked?
Does not work with rotation. It might be a good idea to replace this whole system with one that uses a transformation matrix, to handle rotation and skewing more easily in the future. I'm not a huge fan of this current code.
Related to the PoolVectorArray locking issue (#331). This still doesn't fix the issue itself, but at least Pixelorama does not crash anymore. It is still possible, though, to fail to load a guide when opening a project. Opening it again may solve the issue.
* Basic move tool
* Added marching ants effect on the selection borders
* Rename SelectionRectangle to SelectionShape, make it have non-rectangular shape and multiple SelectionShapes can exist
- Create multiple selection rectangles
- Merge them together if they intersect
- Move the selections (without contents as of right now)
- Gizmos are being drawn but they are not functional yet
Code is very ugly.
* Sort vectors counter-clockwise to be used as polygon borders
I did this, no idea if it works properly, probably won't be used but I thought I'd keep it saved somewhere
* More experiments I may or may not need
Trying to generate a polygon from the individual selected pixels
* Change default rectangle select behavior and ability to clip polygons using Control
* Fix rectangle selection clipping
* Split polygon into two with selection subtracting
* Move selection with contents with the move tool
Code is still a mess, don't bother looking.
* Move some methods from SelectionShape.gd to Selection.gd
The purpose of this is to generalize some selection code, so that it applies to all polygons, the entire selection. More will follow.
* UndoRedo for border moving
Nothing else in the selections system works properly in UndoRedo right now. Needs:
- UR support for creating selections
- UR support for modifying selections (merging and cutting selections together)
- UR support for removing selection
- UR support for moving content
& for all the rest of the remaining features
* Moving all of the selection shape logic to Selection.gd
Handle all of the polygons there instead of having them as individual nodes. Should be easier to handle undo/redo this way. This commit probably breaks move tool + selection tool and undo/redo. Code is still a mess. For your sanity, I hope you are not reading this. I promise I will clean up.
* Move tool works again
Buggy and messy, of course.
* Remove unneeded code and restore selection move undoredo logic
* Made Selection.gd have one big preview_image for when moving content, instead of each polygon having its own image
Could be further optimized for some specific cases. We could also remove selected_pixels from SelectionPolygon.
* UndoRedo support for creating, deleting, merging and clipping selections
UndoRedo support for moving content not added in this commit. Should work but needs more testing. This PR also removes selected_pixels from the SelectionPolygon class.
* Confirm & cancel selection movement, should support undoredo properly too
Press Enter or do any editing to confirm movement, Escape to cancel. I will most likely add UI buttons for confirm and cancel too.
* Mirror View affects selection
* Restore Cut, Copy, Paste and Clear Selection
Pasting now no longer requires a pre-existing selection and instead copies the selections themselves too.
* Created a new Select menu, which has Select All and Clear Selection as options
Clear Selection now also confirms content moving. TopMenuContainer code has changed to no longer rely on Global for the menu buttons.
* Draw gizmos as rectangles
No functionality yet. They may need to be turned to nodes, so that they can easily resize based on zoom level and check for mouse enter/exit events.
* Made gizmos get drawn in the sides and corners of the big bounding rectangle instead of individual selection parts
Still no functionality yet.
* Restore label text
* Minor optimization when clipping selections
This will execute the for loop less times
* Made a Gizmo class, cursor change on hover, has_focus = false on mouse click
Now I should actually make them resize when dragged, aye?
* Very basic gizmo resizing, still a WIP, does not work properly yet
* Start replacing the array of selected pixels with a BitMap
This should optimize the selection making a lot, and it also allows for easy border drawing without having to deal with polygons, thanks to the MarchingAntsOutline.shader
Still commit is still a WIP, image effects and brushes may not work properly yet.
Because the BitMap has a fixed size, the size of the project, moving the selection outside of canvas boundaries has proven to be a bit tricky. I did implement a hacky way of handling it, but it may be buggy and problematic. I'm still unsure whether this is the best way to handle the situation.
* Selection works with mirror view
* Draw a black rectangle when the user is making a rectangular selection
After they release the mouse, the black rectangle becomes the selection
* Make Selection.gd update when undoing/redoing
* Fix brushes not working properly with non-rectangular selections
* Added invert selection
* Cache has_selection as a variable for a speedup
* Fix conflict issues with the shape tools
* Made the bitmap image squared so the marching ants effect will be the same on both dimensions
There may be a better way to fix the issue, perhaps inside the shader itself.
* Some optimizations to call selection_bitmap_changed() less times
* Restored almost all of the image effects
Left to do:
- Change gradient's behavior. Unsure of how it will work with non-rectangular selections yet, but it should not generate pixels outside of the selection.
- Restore rotation
- Resize bitmap on image resize
- Remove the `pixels` array from the ImageEffect
* Fix Selection.gd not updating when changing project
* Resize the selection bitmap along with image resize
* Restored rotation's old behavior and finally got rid of the selected_pixels array
The rotation does not yet work properly with selections, but at least it now "works".
* Resize selection too when using gizmos
Left to do for gizmos:
- Proper cancel transformation
- Begin transformation
(currently named move_content_start but it should be renamed to something more general) when resizing gizmos
- Keep the original image and selection in memory and resize them. Meaning, gizmos should not resize the already resized data, but only resize the original. This is less destructive as there is no danger of data loss.
- Always resize on InputEventMouseMotion. This is going to be worse for performance, but it will look better for the user.
* Image and bitmap resizing now uses the original data and begin transformation on gizmo click
No matter how many times the user resizes on the current transformation, the original data will not be lost until they either confirm or cancel, so there is no data loss before confirmation/cancel.
* Cancel transformation now works properly when the selection has been resized
* Made gizmos resize on mouse motion, fix issues with negative bounding rectangle and when combined with the move tool
* Resizing can now get out of positive bounds, clearing and inverting now gets limited to the canvas bounds
Resizing currently does not work properly with negative (left & up) canvas boundaries
* Flip image when resizing and the bounding rectangle gets flipped
* Call move_content_confirm() when inverting selection
* Attempt to implement selection resizing that goes outside of the canvas boundaries (not working properly yet)
* Flip selection when resizing to negative bounding rectangle sizes
And fix preview_image vertical flipping
* Fix rotation so that it works (almost) properly with selections
Rotation algorithms now accept and only work with a given image, and the pivot has been added as a parameter
* Experimental gizmo rotation - does not work properly yet
Transforming the selection outside of the canvas is still broken.
* Fix some issues with moving selection out of canvas bounds
* Fix more issues with selection getting resized outside of canvas bounds
* Update marching ants effect properly when switching between projects
And make sure the frequency of the marching ants effect always looks roughly the same on all project sizes
* Made the rotation gizmo part of the gizmos array and resize them based on camera zoom
* Remove unneeded parameter from move_bitmap_values()
* Remove more unneeded parameters
* Move the selection only if the cursor is above it and neither shift nor control are currently pressed
* Gradient generation now works on non-rectangular selections
Although this behavior might not be the intended one
* Copy/paste marching ants effect offset
Useful for when the selection is in negative coords
* Fix issue with clear selection & UndoRedo
* Restore the ability to move selection when it's in negative coords
* Made the marching ants offset a Project variable
This fixes the issue of project switching and keeping the previous project's offset. Again, this is only relevant for when the selection is in negative coords.
* Made the "from current selection" palette preset work with the new selection system
* Fix out of bounds error when using the rectangular select tool on negative coords
* Some code cleanup
* Comment out the rotation gizmo for now, since it does not work properly
* Update marching ants shader params and gizmo sizes when the bitmap changes
* Move some methods around in Selection.gd
A performance boost for when opening large images. Also fixed an issue with pixels being selected outside of the canvas boundaries, when the selection rectangle was outside the canvas and its size got reduced.
* Cache tile mode rects
* Make TransparentChecker don't calculate tile mode rect on its own
* Minor fixes
- typo
- formatting
- moved unlock() call to the method where matching lock() was called
* Move get_tile_mode_rect() method to the Project class
* Refactored isometric grid
Now it should be drawn properly in the target rect.
Settings (in pixels):
- cell's AABB size,
- offset from the canvas origin.
* Draw grid only over the Canvas (when in tiling mode)
* Replace some magic numbers with enums.
It's too easy to break something when adding something new in here. Should be a little harder now.
* Added Pixel Grid.
- Pixel grid is shown only when it's enabled and camera is zoomed close enough.
- Settings: pixel_grid_show_at_zoom (as a percentage because that's what's shown in the settings panel), pixel_grid_color. Default values might need changing.
- To distinguish between grid and pixel grid default settings for grid width, grid height are changed.
- Now both grid and pixel grid are drawn above (after) tile mode. Grid is drawn above (after) pixel grid.
It's Cel's property and thus it changes when frame_changed is called (also layer_changed calls frame_changed on its own).
Co-authored-by: kleonc <kleonc@users.noreply.github.com>
Instead of having a frame_duration[] array in the Project class. This makes the code much more readable and understandable, using less lines of code and, by avoiding an extra array, we also avoid potential out-of-bound array crashes.
The functionality for the user has not changed, and by testing so far I didn't find any issues.
When the user switched from one project to another, which had a larger size, the preview of the ImageEffect was trying to set pixels out of bounds, only when the affect option was different than "Current cel"
Export.was_reported was keeping its value when switching projects, instead of being project-specific. Also fixed issue where imported images were not remembering the directory_path and file_name when switching projects.
It now first attempts to serialize the project data and turn them to JSON, and then opens the file. This is a lto safer because, if a crash happens in the serialization, the file is not already open, and therefore it does not get corrupt. Earlier, if a crash happened, the file would be empty. This meant that if that file existed previously, all of the data would be lost.
* Sync for my local files to my repository
* This is frame properties update, it works but I can't be stored while
saving or loading and that makes crashes just the beggining :)
* I forgot this files :P
* Frame Properties update.
* Updating frame properties
* Update Translations.pot
* Changes to CanvasPreview and CelButton change
This will be the parent of all (or most) image effect dialog nodes. Currently only parent on FlipImageDialog, will change to be parent of the rest of the effects.
Instead of drawing individual lines, execute draw_isometric_tile() multiple times. What this method does is basically draws a single isometric tile, which then gets repeated for the entire canvas size. Also moved all the grid logic to a new script, which gets updated less often that Canvas.gd, for optimization purposes.
Works better than the previous method, although it might be a bit slower, and currently does not work well if the canvas size is not divisible by the grid size. For now, it only gets affected by the grid width. Changing grid height has no effect.
This will allow us to create more selection tools in the future, that aren't necessarily rectangular (See #129) and even enhance the current rectangle selection tool (See #56)
Current issues spotted so far:
Drawing is slower for large images, and bucket filling is also considerably slower even on a 64x64 image. Optimizations are required.
Also fixed issue with "Show Guides" view menu option and having multiple projects with guides. Only think remaining is to make the Symmetry Guides look different than regular guides. Closes #133.
Two special guides - one horizontal and one vertical - that let you change the axis of symmetry for mirroring. On the next commit(s) I will make them visible only if mirroring is toggled on. Almost solves #133
* Refactoring tools
* Remove unused code
* Fixed some inferring errors and added translations
* Attempt to fix some Script Errors found in the CI workflow
* Fix bucket crash.
* Fix static type convert.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
The structure of the .pxo files is now consisted of a JSON-structured metadata part, where all the data that can be stored as text are, and a binary part, that contain all the actual image data for each cel and project brush.
This makes it easier for users to understand the .pxo structure, easier to add more changes without having to check versions for backwards compatibility, easier to be opened by third-party apps and it allows us to make an "Export JSON metadata" option, that will export just the metadata in JSON format, without the binary image data.
It's backwards compatible and .pxo files from as far as v0.5 are still supported.
If the current project is empty (only 1 layer and frame, no tags and the image has no content - is invisible) and the user is opening a project, then the opened project will not open a new tab of its own, and will use the currently opened one instead.
A Project class contains project-specific data like name, undo_redo, frames, layers, tags and brushes. These variables have been moved from Global. This is the first step towards multiple tab support, where each tab will be a different Project.
The Canvas is now single node, instead of having multiple canvases for each frame. This should also be a performance optimization, since there are less canvas nodes, so there are less _input() calls. It should also fix a rare Undo/Redo issue with motion drawing and making lines. Could be unstable, needs more testing.
As a side effect, the guides are now the same for all frames, so this should also close #246.
* Refactoring image_menu_id_pressed method in Main.gd (#243)
* Refactoring image_menu_id_pressed method in Main.gd
I've moved the code from each "match" case into a seperate method to make it more readable.
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Refactoring Main.gd. Mostly cutting big methods into smaller ones. (#244)
* Refactoring Main.gd. Mostly cutting big methods into smaller one.
- Reduced size of _ready method in Main.gd
- Moved code from certain parts of old _ready method into seperate methods
- Fixed the translation bug related to CurrentFrame node in TopMenuContainer scene. The CurrentFrame node wasn't updating the language when I was changing language. I've also changed the translation file for this.
- Fixed Global.palette_option_button.selected related warning. Because of some unknown reasons, git didn't push completed line there.
- Moved code from file_menu_id_pressed and view_menu_id_pressed method in Main.gd to separate methods to make it more readable.
* Removed window_title changes from Main.tscn
Co-authored-by: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com>
* Fixed TextureRect images of the circle brushes in BrushesPopup
They all had the pixel brush image in their TextureRect
* Split code from PreferencesDialog.gd to HandleLanguages.gd
Also moved PreferencesDialog script & scene to src/Preferences. More Preferences code splitting will follow.
* Split theme related code from PreferencesDialog into HandleThemes.gd
* Moved shortcuts code from PreferencesDialog
* Created DrawingAlgos.gd and moved a lot of drawing code there
Moved code from Global.gd and Canvas.gd to DrawingAlgos.gd. Will also move the fill_gaps and draw_brush methods of Canvas.gd next. Maybe even refactor the inside of them a bit to make them easier to read.
* Connected "files_dropped" signal to a method
This lets the user drag and drop files into Pixelorama, while it runs, to open them. This doesn't work properly and will crash when it can't open the files. It will get merged into master soon.
* Renamed handle_running_pixelorama_with_arguments() to handle_loading_files()
handle_loading_files() is also used for _on_files_dropped()
* Moved draw_brush() and fill_gaps() from Canvas.gd to DrawingAlgos.gd
draw_brush() is currently very ugly and probably needs inside refactoring
* Removed coord clamping from fill_gaps()
This should make line making behave as expected when the mouse is outside of canvas boundaries
* Drawing is no longer limited by the canvas boundaries
his means that, if you have a brush largen than 1px, you can draw on the edges of the canvas. All pixels that are being drawn outside of the canvas will still have no effect.
* Use enums instead of strings for tools
This could be a slight increase in performance
* Fixed line making with Shift and don't let color picker pick colors outside of canvas
* Changed Global node variables to arrays for left/right
Instead of having 2 variables for left & right nodes, use an array instead. This will help with better looking code, automation and less repetitive code, as seen in ToolButtons.gd. Move related refactoring will follow.
* More Global left/right variables became Arrays
Global.update_left_custom_brush() and its right counterpart have also now become Global.update_custom_brush(mouse_button : int)
* Use Global.Mouse_Button instead of strings for comparison
This should be a slight increase in performance
* Refactoring perferences dialog (#251)
* Added ItemList to themes
* Language and theme checkboxes are now radio buttons
* Even more Global left/right variables became arrays
ColorAndToolOptions has now the same code for left and right tool options, with more similar refactoring coming soon to places like Canvas and DrawingAlgos
* Refactored Canvas.gd
* Refactored DrawingAlgos.draw_brush(), made draw_pixel() method
This also fixes alpha blending and lighting/darkening issues when drawing pixels with mirroring.
* Remove draw_pixel(), use draw_pixel_blended() instead
* Ignore warnings
I don't know what else to do about them, they seem trivial anyway
* Use enum instead of strings for Global.theme_type
Another potential small performance boost when changing themes.
* Use a new Layer class to handle layer information
This replaces the old Global.layers nested array mess, and makes the code easier to read and to understand.
* Fixed linked cel crash and layer naming
* Created a new Cel class, to handle cel information
Like the Layer class, it is used in place of Canvas.layers nested array mess. It hasn't been tested thoroughly yet, so there may be crashes.
* Fixed issue where if you moved a frame to the start (move left), it was invisible
* Added AnimationTag class
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.
Co-authored-by: Igor Santarek <jegor377@gmail.com>
Co-authored-by: Kinwailo <lokinwai@gmail.com>
Replaces nested Global.animation_tags arrays. Also replaced array.duplicate(true) with looping through the array and creating a new class for each array element, because duplicate(true) does not create new classes, unfortunately, which was causing issues with undo/redo.