Commit graph

149 commits

Author SHA1 Message Date
clayjohn
0c0e1a637e Remove extra range conversion in Sprite3D normal encoding 2022-12-14 15:41:43 -08:00
MrBlockers
92ebbf2c0a Fix multiple issues with region editor
Make the filter mode of the texture preview match the node/resource
being edited where applicable, and nearest neighbor with mipmaps as a
fallback.

Make the Edit Region button for Sprite3D only appear when region is
enabled, to match behavior of Sprite2D.

Fix the editor not correctly clearing reference to previously edited
resources, resulting in a visual bug displaying the incorrect texture.
2022-10-25 18:23:23 -04:00
RedMser
a8a4e290fb Remove incorrect px suffixes 2022-10-10 18:18:15 +02:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Rémi Verschelde
c44e1c4e31
Merge pull request #66064 from kleonc/sprite3d-fix-drawing-with-vertical-margins
`Sprite3D`/`AnimatedSprite3D` Fix drawing `AtlasTexture`s with vertical margins differently than in 2D
2022-09-20 23:06:26 +02:00
Marc Gilleron
aed3822a93 Change return type of get_configuration_warnings to PackedStringArray 2022-09-19 16:43:15 +01:00
kleonc
8a56100d39 SpriteBase3D Fix drawing AtlasTextures with vertical margins differently than in 2D 2022-09-18 20:08:31 +02:00
kleonc
8837d41b50 Move duplicated drawing code from Sprite3D/AnimatedSprite3D to SpriteBase3D 2022-09-18 20:03:03 +02:00
Rémi Verschelde
16d44395b5 Merge pull request #65148 from Mickeon/animated-sprite-negative-speed-scale
Allow negative `speed_scale` in AnimatedSprite2D & 3D
2022-09-16 09:18:42 +02:00
Micky
8142bc4ddd Allow negative speed_scale in AnimatedSprite2D & 3D
If the `speed_scale` is set to a negative value, the animation plays in reverse.
The second parameter of `play()` still reverses as before. if `speed_scale` and the second parameter of `play()` is true, the animation plays forward.

Also updates the documentation to better describe the pausing and playing behaviour.
2022-09-13 12:41:07 +02:00
kobewi
d5c703b83e Don't store frame of playing AnimatedSprite 2022-09-12 22:59:35 +02:00
Micky
b648ee43ab Harmonise AnimatedSprite3D and its 2D counterpart
Add the following properties to AnimatedSprite3D:
- `backwards` parameter in `play()`;
- `speed_scale`.

Both classes' internals are more similar, down to the line spacings. They've also been updated to be clearer and less inconsistent (e.g. `!frames.is_valid()` -> `frames.is_null()`, use SceneStringNames instead of CoreStringNames, rename the internal _queue_update to _queue_redraw)
2022-09-09 21:06:24 +02:00
Rémi Verschelde
ca59f47f31
Merge pull request #64157 from Mickeon/remove-mysterious-is-playing 2022-09-01 17:40:32 +02:00
jmb462
ae9560af82 Fix AnimatedSprite2D & 3D animation list in inspector 2022-08-26 00:05:58 +02:00
Rémi Verschelde
1f61d47766
Merge pull request #64339 from YuriSizov/core-multilevel-validate-property 2022-08-22 21:39:48 +02:00
Yuri Sizov
1a24c9e14b Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00
Omar El Sheikh
2425d798cd Octahedral Normal Support for Sprite and Soft Body
Properly encode the normal and tangent vectors with octahedral
compression
2022-08-20 10:01:46 -07:00
Micky
83f96139ac Remove AnimatedSprite3D.is_playing() for redundancy
Also removes the underscore prefix from `_set_playing()` and `_is_playing()`
2022-08-09 13:20:07 +02:00
Hugo Locurcio
fa019f6e14
Change default material alpha scissor threshold to 0.5
This makes the default behavior consistent between SpriteBase3D,
BaseMaterial3D and imported glTF scene materials.

Alpha scissor threshold property hints now allows for more precise
adjustments as well.
2022-08-01 02:00:16 +02:00
kleonc
73ecd71b7d Fix no hint_string for frame property in AnimatedSprites 2022-07-03 15:31:43 +02:00
FireForge
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
Haoyu Qiu
312ec612c7 Add autocompletion for AnimatedSprite.play() 2022-05-05 14:36:35 +08:00
bruvzg
0a0e94d996
Expose Label3D and Sprite*3D material render priority properties. 2022-04-30 15:09:30 +03:00
Rémi Verschelde
8dfa12cae7
Merge pull request #59979 from bruvzg/cpp_check2 2022-04-27 10:08:26 +02:00
bruvzg
be611c1c05
Implement Label3D node.
Add "generate_mipmap" font import option.
Add some missing features to the Sprite3D.
Move BiDi override code from Control to TextServer.
Add functions to access TextServer font cache textures.
Add MSDF related flags and shader to the standard material.
Change standard material cache to use HashMap instead of Vector.
2022-04-22 12:08:46 +03:00
bruvzg
de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
Rémi Verschelde
7119d355eb String: Remove TTR and DTR defines in non-tools build
This ensures we don't use TTR in runtime code, as it's specifically meant
to source translations for the editor.
2022-03-28 20:26:35 +02:00
reduz
6f51eca1e3 Discern between virtual and abstract class bindings
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract".
* Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions.
* Converted a large amount of classes from "abstract" to "virtual" where it makes sense.

Most classes that make sense have been converted. Missing:

* Physics servers
* VideoStream
* Script* classes.

which will go in a separate PR due to the complexity involved.
2022-03-10 12:28:11 +01:00
Haoyu Qiu
3a439a9c03 Fix AnimatedSprite infinite loop 2022-02-28 16:00:45 +08:00
Rémi Verschelde
b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
Rémi Verschelde
0f5455230c
Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
Nathan Franke
8a0a3accee
simplify formatting scripts, add a clang-tidy script, and run clang-tidy 2022-01-29 04:41:03 -06:00
Rémi Verschelde
929f483ca0
Merge pull request #55446 from Calinou/spritebase3d-remove-opacity 2022-01-12 16:49:57 +01:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Nathan Franke
49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Jonathan Gollnick
0c14b930ef
Fix _validate_property on AnimatedSprite 2D and 3D 2021-12-08 16:59:11 -06:00
Rémi Verschelde
ced07100d7
Merge pull request #53287 from Chaosus/sprite3d_fix 2021-12-02 16:23:33 +01:00
Hugo Locurcio
1b59818fb3
Remove redundant SpriteBase3D opacity property
The `opacity` property is superseded by the GeometryInstance3D
`transparency` property. It works the opposite way (0.0 is opaque,
1.0 is fully transparent), but provides the same behavior in a more
universal manner.
2021-11-29 16:13:55 +01:00
reduz
d03b7fbe09 Refactored Node3D rotation modes
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis

Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-25 14:34:00 -03:00
kleonc
b266b59e56 Fix rendering centered odd-size texture in AnimatedSprite2D/AnimatedSprite3D 2021-10-03 14:30:51 +02:00
Yuri Roubinsky
1ade29147b Add texture_changed signal to Sprite3D 2021-10-01 10:14:05 +03:00
Max Hilbrunner
e0355d5db6
Merge pull request #43573 from lewiji/master
sprite_3d.cpp: return _is_playing() from public is_playing() function
2021-08-28 19:55:54 +02:00
Aaron Franke
84f720966c
Use doubles for time in many other places 2021-08-09 14:05:42 -05:00
Aaron Franke
7cec3c2b95
Use real_t in 3D nodes 2021-08-03 11:16:51 -05:00
Aaron Franke
4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
jfons
cfb555a081 Node3D gizmo improvements
* Clean-up of node_3d_editor_plugin.{h,cpp}: removed unused code, fixed some bugs.
* Moved node_3d_editor_gizmos.{h,cpp} to editor/plugins.
* Added support for multiple gizmos per node. This means custom gizmos will no longer override the built-in ones and that multiple gizmos can be used in more complex nodes.
* Added support for handle IDs. When adding handles to a gizmo, an ID can be specified for each one, making it easier to work with gizmos that have a variable number of handles.
* Added support for subgizmos, selectable elements that can be transformed without needing a node of their own. By overriding _subgizmo_intersect_frustum() and/or _subgizmo_intersect_ray() gizmos can define which subgizmos should be selected on a region or click selection. Subgizmo transformations are applied using get/set/commit virtual methods, similar to how handles work.
2021-07-23 21:01:10 +02:00
Aaron Franke
09f0596eb2
Explicitly cast to float when creating a float array 2021-07-19 01:21:22 -04:00
reduz
9ad0c6cde7 Import mesh colors in 8BPP.
* Colors were imported as 16BPP (half float)
* Far most common use cases only require 8BPP
* If you need higher data precision, use a custom array, which are supported now.

**WARNING**: 3D Scenes imported in 4.0 no longer compatible with this new format. You need to re-import them (erase them from .godot/import)
2021-06-30 23:33:25 -03:00
reduz
85cf99f28e Deprecate ImmediateGeometry
* Removed entirely from RenderingServer.
* Replaced by ImmediateMesh resource.
* ImmediateMesh replaces ImmediateGeometry, but could use more optimization in the future.
* Sprite3D and AnimatedSprite3D work again, ported from Godot 3.x (though a lot of work was needed to adapt them to Godot 4).
* RootMotionView works again.
* Polygon3D editor works again.
2021-06-30 14:14:41 -03:00
Yuri Roubinsky
19afaa0203 Fixed a bunch of connection errors in TextureEditorPlugin 2021-06-12 08:01:02 +03:00