Git Product home page Git Product logo

smoothing-addon's Introduction

smoothing-addon v 1.2.2

Fixed timestep interpolation gdscript addon for Godot 3.2 (and later versions)

Update

As of Godot 3.5, 3D physics interpolation is build into the engine, and as of 3.6 (beta 4 onward) 2D physics interpolation is built in. New users are recommended to use core interpolation, rather than this addon.

https://docs.godotengine.org/en/3.6/tutorials/physics/interpolation/index.html

However, the addon is maintained for compatibility purposes with existing games, and previous versions of the engine.

Introduction

If you were wondering how to use that new function Engine.get_physics_interpolation_fraction() in 3.2, feel free to use this as is, or to get ideas from for your own version.

If you find bugs / have suggestions, please add an issue to the issue tracker and I will look into it! :)

The smoothing addon adds 2 new nodes to Godot, 'Smoothing' (for 3d) and 'Smoothing2d' (for 2d). They allow for fixed timestep interpolation without writing any code. See here for an explanation of fixed timestep interpolation:
https://www.gamedev.net/blogs/entry/2265460-fixing-your-timestep-and-evaluating-godot/
https://www.youtube.com/watch?v=lWhHBAcH4sM

Installation

This repository contains the addon (in the addons folder) and an example demo project.

To use the addon in your own project:

  1. Create a new project in Godot or use an existing project.
  2. Copy the 'addons' folder from this repository to your Godot project folder.
  3. Go to 'Project Settings' plugins tab.
  4. Find the smoothing plugin and set status to 'Active'.

Explanation

In a game you would usually choose to create a Node2D, Spatial, RigidBody, Kinematic body etc node for a game object, which is affected by physics and / or AI and / or player input. This I will refer to as the PHYSICS REP (representation).

The visual respresentation of this object (VISUAL REP) is often simply a child of this node, such as a MeshInstance, or Sprite. That way it inherits the transform of the parent physics rep. When you move the physics rep, the transform propagates to the child node, the visual rep, and it renders in the same place as the physics rep. In some games the visual rep can even be the same node as the physics rep (particularly when there is no actual physics).

Usually transforms propagate from a parent to child. Fixed timestep interpolation works slightly differently - the VisualRep indirectly follows the transform of the PhysicsRep, rather than being directly affected by it.

In your gameplay programming, 99% of the time you would usually be mostly concerned with the position and rotation of the physics rep. Aside a few things like visual effects, the visual rep will follow the physics rep, and you don't need to worry about it. This also means that providing you drive your gameplay using _physics_process rather than _process, your gameplay will run the same no matter what machine you run it on! Fantastic.

Note

The 3D smoothing node automatically calls set_as_toplevel() when in global mode. This ensures that it only follows the selected target, rather than having the transform controlled directly by the parent. The default target to follow will however be the parent node, if a Target has not been assigned in the inspector.

In 2D, flips are supported. That is, if you use negative scaling to flip a sprite, the interpolation will detect this and turn off for a tick to get an instantaneous flip, instead of having the sprite "turn inside out".

Usage

3D

  1. You would usually in a game choose to create a Spatial, RigidBody, Kinematic body etc node for your physics rep, and have a visual representation (e.g. a MeshInstance) as a child of this node.
  2. Do this as normal so that you can see the object moving in the game.
  3. Add the new 'Smoothing' node to the scene, as a child of your physics rep.
  4. Drag the visual representation from being a child of the physics rep, to being a child of the Smoothing node.
  5. That is mainly it! Just run the game and now hopefully the visual representation will follow the gameobject, but now with interpolation. You can test this is working by running at a low physics tick rate (physics_fps in project settings->physics).

2D

The procedure for 2D is pretty much the same as with 3D except you would be using a node derived from Node2D as the physics rep (target) and the 'Smoothing2D' node should be used instead of 'Smoothing'.

In 2D, for legacy support, the smoothing node can be set to toplevel if the property flag is enabled (this defaults to disabled). toplevel enables the transform of the smoothing node to be specified in true global space (which is more stable, and may play better with GPU snapping), and makes things simpler because the smoothing node can be a direct child of a target.

You are recommended to try toplevel mode, however there are two downsides which may preclude its use:

  1. Parent node visibility is not automatically propagated to toplevel nodes, thus you have to explicitly hide the smoothing node, rather than rely on hiding just the parent node.
  2. Y-sorting does not work correctly for toplevel nodes.

Following targets that are not the parent node

When not using toplevel mode in 2D, and in other problematic situations you may see jitter. In this case you may want to use the smoothing node's ability to follow targets that are not parent nodes. You can do this by assigning a Target in the inspector panel for the Smoothing node.

In this situation you are highly recommended to place the smoothing node on a separate branch in the scene tree, preferably inheriting no transform from a parent node (i.e. all the parents and grandparents will have zero translate, no rotate, and 1:1 scale).

e.g. Instead of:

Root
    PhysicsRep
        VisualRep (child of PhysicsRep)

The relationship becomes:

Root
    PhysicsRep
    VisualRep (child of Root)

To enable interpolation instead of relying on the scenetree transforms being propagated to children, we specifically tell the VisualRep to follow the PhysicsRep. This way it can follow the position and rotation of the PhysicsRep WITHOUT being directly affected by the transform of the PhysicsRep.

This may sound overly complicated, but because of the maths involved, it is usually essential to getting a good result.

Teleporting

There is one special case when using smoothing nodes - the case when you want a target to instantaneously move from one location to another (for instance respawning a player, or at level start) where you do not want interpolation from the previous position. In this special case, you should move the target node (by setting the translation or position), and then call the 'teleport' function in the Smoothing node. This ensures that interpolation will be switched off temporarily for the move. Make sure to call teleport AFTER moving the target node, rather than before.

Other options

As well as choosing the Target, in the inspector for the Smoothing nodes there are a set of flags.

3D

  1. enabled - chooses whether the smoothing node is active
  2. translate - interpolation will be done for the position
  3. basis - interpolation will be done for rotation and scale
  4. slerp - this will do quaternion slerping instead of the simpler basis lerping. Note that this only works with no scaling applied to the target.

2D

  1. enabled - as above
  2. global in - will read the global transform of the target instead of local
  3. global out - will set the global transform of the smoothing node instead of local

(Local mode may be more efficient but you must understand the difference between local and global transforms.)

Notes

  • Processing will also be turned off automatically for the smoothing nodes if they are hidden (either directly or through a parent).
  • You can also set the target for the smoothing node from script, using the set_target function and passing a NodePath argument (e.g. mynode.get_path()).
  • The best way to debug / develop smoothing is to set physics ticks per second (ProjectSettings->Physics->Common->Physics_FPS) to a low value (e.g. 10). Once you have it working you can set it back up to high value if desired.
  • If you encounter problems smoothing a Camera2D node, try setting the ProcessMode to Idle instead of Physics.
  • In order to prevent an unneeded extra delay of one tick, it is important that smoothing nodes are processed AFTER target nodes. This should now be automatically taken care as the addon internally uses process_priority to achieve this. Previously we required smoothing nodes to be placed lower in the scene tree than the target. This should hopefully no longer be the case.
  • Fixed timestep interpolation may not work well in 2D pixel snapped games. For further info see https://github.com/lawnjelly/godot-snapping-demo .

There is no need for JitterFix (Project Settings->Physics->Common->Physics Jitter Fix) when using fixed timestep interpolation, indeed it may interfere with getting a good result. The addon now enforces this by setting Engine.set_physics_jitter_fix to 0 as smoothing nodes are created.

Authors

Lawnjelly, Calinou

This addon is also available as a c++ module (slight differences), see: https://github.com/lawnjelly/godot-smooth

Addendum

Physics Interpolation is now available in core Godot as of 3.6, and you are encouraged to use core interpolation rather than addons wherever available. It should be:

  • Easier to use.
  • Introduces new 2D mode to get around toplevel problems.
  • More accurate (particularly for pivots).
  • Faster.

See the official documentation for details.

smoothing-addon's People

Contributors

calinou avatar lawnjelly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smoothing-addon's Issues

"Ghosting" effect when hide and show object

Hi!
This addon is incredible, the movement of the character and other objects has become much smoother. However, I have a problem, where I hide an object, but when I make it visible again, for a moment, the object appears in the last position where it was seen before being hidden and then immediately moves to the correct position.

On 22 seconds, you can see that. The video is in slow motion.

2024-05-03-22-41-21_QhL1NSKj.online-video-cutter.com.mp4

Flip being smoothed

I have a problem: the addon is smoothing the character's "flip," which is the negative scale. I wish there was a way not to smooth this. Unfortunately, if I disable the option scale from inspector.. everything gets messed up. I saw that I can use Teleport to change the position without interpolation... But would it work for my case?

godot 4 low process priority causes stutter

Hey lawnjelly, thanks for this great addon!
Had some issues in 4.1.3 with the plugin in 2d:
The smoothed sprite was several frames behind (input lag) and had stutters, which became really noticeable when i attached a ui label as child to the smoothed sprite. All this problems went away when setting set_process_priority(100) to 0 in smoothing_2d.gd's _ready() function.

Whats the reasoning for setting the process priority that low? Are there issues i could run into leaving it at 0? (edit: nvm, found the readme section about it)

Visible jitter when instantly moving player.

For my project, I have included a crouching mechanic.

Crouching in many games will typically move the player directly downwards to compensate for the change in collision shape size, but doing this with the Smoothing node causes a very noticeable jitter.

Is there some kind of workaround I can implement to avoid this jitter when changing position instantaneously?

Unable to use camera node in 3d along with smoothing node

Scene causing the problem with smoothing node added:-

prob_scene

Script attached to Player node (Kinematic Body):-

extends KinematicBody
var constant_speed: Vector3 = Vector3(0, 0, -10)
func _physics_process(_delta):
    constant_speed = move_and_slide(constant_speed)

Output:-

prob_runtime_trim

Expected Output:-

fine_runtime_trim

As seen in the first output gif the player moves away from the camera which it shouldn't. The expected output is what it should look like.

The following scene without the smoothing node works as expected and gives the expected output:-

fine_scene

Recursion bug in `_set_flags` in 4.x version

Seems to be some kind of infinite recursion bug in Godot 4.x. Shows when pressing space bar to teleport in the demo project.

I'm not sure at this stage whether it is a bug in Godot core or the addon. Needs investigating.

Smoothing a smoothed camera can cause jitter

I have the following setup, a Sprite wrapped in a Smoothing2D that targets a KinematicBody2D. I also have a Camera2D with smoothing enabled, that follows the character. It is a child of the Sprite. This all works fine.

But I noticed issues when you also want to have something that follows the Camera2D rather than the player. In my case I wanted to have a Light2D right in the center of the screen, so I first tried setting this as a child of the Camera2D. Turns out the Camera2D doesn't actually update its position during smoothing, but I managed to work around that by attaching a script to my Light2D that compensates with the actual camera position that you can get in get_camera_screen_center().

This seems to work, but I noticed that the when the character quickly changes movement direction, the light seems to lag behind one frame. Here's a video of it in action

double_smooth.mp4

I figured the reason is probably that my script on the Light2D was updating before the camera smoothing and therefore using the old position, so I increased the process priority to ensure that it happened after, but nothing happened. It wasn't until I tried setting it to a ridiculously high value of 100 where suddenly - the issue was gone.

Turns out the reason is this line, which sets the process priority to an arbitrarily high value of 100, just like I did:

set_process_priority(100)

I'm not sure if there's a good fix for this. In my case, I realized that a better solution is probably to just place the Camera2D under the KinematicBody2D instead. It means that the camera smoothing will be completely separate from my character smoothing, but in my case that looks pretty good, maybe even better. And the Light2D follows at the center of the screen as expected.

Hopefully just by reporting this, someone might find this issue and be able to find a solution faster than I did. I have also attached a minimal project to test this.

camera2d-smoothing-demo.zip

Activation of Snaps causes unsmoothed visual jitter

With the new approach, not using TopLevel to solve issues in Ysort, I noticed that smoothing doesn't seem to work when snap options are active, such as Snap vertices and transformations. Previously, with Top Level, the jitter was resolved. Now, it seems that it's no longer rounding the sprite's position and causing visual jitter. I tested this on version 4.x. ~It seems that without top level, there might be some limitation, perhaps?

Jitter with moving player

Hi, so as mentioned in my other issue I seem to have Jitter (I think) with a moving player.

Here is a video of what I mean. The sprite seems unsharp, almost filtered. Though it is not filtered. It looks like the position is slightly changing really fast. At the end of the video, I think from second 12 on you can see suddenly after moving the character a bit, the sprite gets sharp (actually, when starting the scene it's sharp and becomes unsharp after movement). This happens both when using toplevel and the default mode as shown on the screenshots below*.
https://github.com/lawnjelly/smoothing-addon/assets/9001667/3a04a6cf-4fd1-4fa9-a761-c02a3b01cc75

Any suggestion to prevent this?

*Tried these setups:
Screenshot_20231031_085741

Screenshot_20231031_090404

This would be the project I am testing this with:
testproject.zip

Heavy jitter from Camera2D scroll on Godot 4.2 (beta1)

Hi there!

I'm trying to use the smoothing add-on in a top-down 2D setup, but this far I'm failing to make it work with a Camera2D that scrolls to follow the character.

I think I've setup the scene as documented (find MRP attached), no pixel snapping is enabled:

CharacterBody2D
|__Smoothing2D
   |__Sprite2D
      |__Camera2D

When both FPS and physics ticks are set at 60, everything looks good:

tick60.mp4

When reducing physics ticks to 20/s, stutter is very bad on camera scroll, it looks like Camera2D and Smoothing2D are fighting:

tick20.mp4

When setting the camera to run on physics, instead of idle, jitter is not that bad, but still very bad:

tick20+camera-physics.mp4

Smoothing the camera position fixes it! But forces to use a smoothed camera, which I didn't intend to (the recording doesn't actually show the camera's delay behind the character, happens in real-time play though):

tick20+camera-smoothed-position.mp4

As usual, setting Smoothing2D as toplevel fixes the jitter, but breaks y-sorting, which is a deal-breaker:

tick20+toplevel.mp4

I've also tried to make Camera2D a child of all the other nodes, with the same result.

Is my setup wrong / am I missing something? Or is Godot 4.2's Camera2D known to break the add-on?

Thanks for your time and for a great tool!

(By the way, amazing pixel art by https://limezu.itch.io/!)

[Godot 4.x] Smoothing node that has a sprite with a target of CharacterBody2D always enters the scene at the origin

I have a player with a node structure like this;
image
and whenever i run the scene (or another scene that its placed to) no matter where i place the player in the editor the visual representative always starts at the origin, the collision shape as you can see remains at where i moved the player back in the editor, however the sprite always begins the scene at the origin, smoothing seems to work but it looks very weird and is unusable as sprite and the body are at different places.
image
Here is the sample project, you can run the "Testing" scene and see the issue yourself. (Sorry if i made a mistake and this isn't actually an issue but when i try the same thing at Godot 3.x it works fine)
SmoothingCharacterBody2DIssue.zip

Godot 4 FPS Support

When using the 3d smoothing node on the head of my character, it works really well to smooth the movement instead of jittering at physics speed. The problem is :

Camera rotation is not updated in physics ticks!

When using a smoothing node before the camera, then rotations are smoothed rather than keeping their updated values between physics frames.

When disabling 'basis' on the smoothing node, rotation will not update with the parents, removing rotation altogether.

This makes setting up an FPS controller that doesn't have jitter very complicated.

Still getting jitter from the camera movement

Thank you so much for this addon, it works very well with the kinematic2D player, but my game is still very jittery because the camera movement. Is it possible to use the addon to smooth the camera?

problem with spawning scene with smoothing

i noticed that when spawning scenes that has this addon, at _ready it will always interpolate from the origin to the point you want the scene to spawn. i looked in the code and i replaced at line 36 this:

`var _m_Trans_curr: Transform2D = Transform2D()

var _m_Trans_prev: Transform2D = Transform2D()`

with this:

`@onready var _m_Trans_curr: Transform2D = get_parent().transform

@onready var _m_Trans_prev: Transform2D = get_parent().transform`

and so far it worked like a charm. for sure it's probably not the best way to go about it (probably), but i wonder if you could implement the fix in a way or another.
:)

Jitter in 2D Window with KinematicBody2D

Thank you for putting this together. It may be that I have not set up correctly as I don't see the addon doing anything.

physics set to 60 fps
Physics Jitter 0 to 0.5 --> no difference
Use VSync On --> no difference
Use VSync Composite -> huge difference for about 15 seconds then jitters, but less than without

I don't see that mesh connection like in 3D. So I just connected the player. Am I supposed to connect something else?
global in --> no difference
global out --> no difference

Did I set up something incorrectly? I don't see any differences with the addon on or off.

image

image

Lerping angle in 2D

I see that the 2D node is using a home made _LerpAngle() function. What is the reason for not using the lerp_angle() builtin? Apart from that -- great work!

Add global in and global out flags to Smoothing (3D)

So I ran into the same issue as #7 and attempted to get around it by setting the Smoothing node as toplevel, but then realized that interpolation happens in local space for 3D nodes. Admittedly I don't know how feasible it would be to interpolate in world space (my math's not the best), and the workaround described in #7 (comment) does work, but it'd be nice not to have to reorganize the scene tree, especially for more complex scenes (not to mention changing a bunch of node paths).

On Windows: Unable to load addon script from path. This might be due to a code error in that script.

The addon worked fine on Linux, but when I reopened the project on Windows I got this every game start:

Warning
Unable to load addon script from path: 'res://addons/smoothing/smoothing_plugin.gd’. This might be due to a code error in that script.
Disabling the addon at 'res://addons/smoothing/plugin.cfg' to prevent further errors.

Godot 4 0 2 Windows - Cannot enable smoothing addon

If I open the Project Settings I can see the addon is disabled. Enabling it then re-disabling it confirms disabling and will stop showing the error. In this case you cannot Add more Smoothing2D nodes, but the existing nodes will still work.

So technically it shouldn't break exported games.

Attaching Control under Smoothing2D causes assert error: _SetProcessing(): Condition "!viewport" is true on set_as_top_level

I know it's not common to attach a Control of a PhysicsBody2D, but I have a local HUD displaying life gauge near attached to my CharacterBody2D so it's convenient, and I need to smooth it or it will jitter relatively to my smoother character sprite.

(usually I'd use a Canvas Layer and manually move the gauge to match character, but it's more complex)

When you do so, you get a double assert error on start: _SetProcessing(): Condition "!viewport" is true on set_as_top_level:

Godot code:

func _SetProcessing():
	var bEnable = _TestFlags(SF_ENABLED)
	if _TestFlags(SF_INVISIBLE):
		bEnable = false

	set_process(bEnable)
	set_physics_process(bEnable)

	set_as_top_level(_TestFlags(SF_GLOBAL_OUT))  # here

Callstack:

E 0:00:01:0024 smoothing_2d.gd:110 @ _SetProcessing(): Condition "!viewport" is true.
<C++ Source> scene/gui/control.cpp:2984 @ _notification()
smoothing_2d.gd:110 @ _SetProcessing()
smoothing_2d.gd:57 @ @flags_setter()
smoothing_2d.gd:234 @ _ClearFlags()
smoothing_2d.gd:245 @ _ChangeFlags()
smoothing_2d.gd:121 @ _notification()

(this shows twice)

However, the Control is still smoothed correctly, although set_as_top_level failed, apparently because it's called again later.

Error: Basis must be normalized in order to be caster to a Quaternion...

Line 201 in smoothing.gd, it's the rotation part.
I solved the issue by adding .orthonormalized() at line 136 on the global_transform.
I think the problem come from this:

Player physics process:

var lerps = Math.lerp_angles(owner.rotation.y, Vector2(direction.x, -direction.y).rotated(1.57).angle(), 5.0 * delta)
owner.rotation.y = lerps

Math.gd

func short_angle_dist(from, to):
	var max_angle = PI * 2
	var difference = fmod(to - from, max_angle)
	return fmod(2 * difference, max_angle) - difference

func lerp_angles(from, to, weight):
	return from + short_angle_dist(from, to) * weight

The full error is:
E 0:00:18:0186 smoothing.gd:201 @ _process(): Basis must be normalized in order to be casted to a Quaternion. Use get_rotation_quaternion() or call orthonormalized() if the Basis contains linearly independent vectors.
<C++ Error> Condition "!is_rotation()" is true. Returning: Quaternion()
<C++ Source> core/math/basis.cpp:702 @ get_quaternion()
smoothing.gd:201 @ _process()

and the rotation get stuck until project close

How to use toplevel in 2D

Hey, so I've read the paragraf on toplevel multiple times but have not clue how to make it work. The basic setup of the plugin including use was pretty simple but toplevel - no idea.

So what works is this without toplevel
(Additional node: No target explicitly assigned on the smoothing node)

How would I set this up for toplevel, to test ist out?

Sorry if that might be obvious, but I'm new to godot (not to development) and cannot seem to figure it out.

Cheers!

Edit: Kudos for the plugin btw.! This is essential.

Jitter when using KinematicBody

Scene structure:-
Interp_cam_outside

  • World Scene is the main scene where player and block scenes are instanced.
  • Target for InterpolatedCamera node is CameraFollow node.

Player Script:-

extends KinematicBody
var constant_speed: Vector3 = Vector3(0, 0, -29)
func _physics_process(delta):
    constant_speed = move_and_slide(constant_speed)

Block Script:-

extends RigidBody
func _ready():
    linear_velocity = Vector3(0, 0, -29)

Output:-
Interp_cam_outside_short

As seen in the output the Small cube = Player (Kinematicbody) is causing jitter, the Bigger Block = RigidBody is fairly stable.

I tried putting the Interpolated camera as a child of Smoothing node which gives me the following result:-

Interp_cam_inside

Output:-

Interp_cam_inside_short

Here, the Small cube = Player (Kinematicbody) is smooth but the Bigger Block = RigidBody is causing jitter.

Now the problem doesn't exist if both bodies are Rigidbody.

minimal reproduction project:-
kinematic_smoothing_prob.zip

Jitter still present when FPS is lower than physicsFPS

The problem

I created a simple little game but on some weak gpus (mobile) it does not run very well. This created a jitter. I tried to apply this addon to fix the issue but it did not work. After looking at the code a bit I think I found the problem. All in 2D, fps limited to 58, physics_fps is set to 60.

What I think is wrong

In the code the last frames that are used for the interpolation are updated in the process function via the RefreshTransform() function. This works perfectly if the game runs at a high fps with relatively slow physics. However this is problematic in case the visual process can run twice between two physics frames. In this case the previous and current positions are updated twice, effectively to the same value. This makes the object jump to the next frame, same as if no interpolation was applied.

My fix

For me, changing the code in a way that the positions are always updated in the pyhsics_process fixed the issue.

Is there a reason the updates are implemented inside the process function with flags signaling wether to use it or not? To me it looks like the flags only try to mimic the case where the physics_process function updates the positions.

Otherwise I really like this addon, it helped me a ton. Hope I could help.

Can't import to Godot 4.x

I'm trying to make an infinite runner in Godot 4, however when I try to import, it says it can't. Furthermore, I look into the files, and many of them have Godot 3 syntax. This confuses me because others can run it on Godot 4. Can someone plz explain to me what I can do to fix? Probably a stupid question, I'm fairly new to Godot.

Visibility not propagated since changing to using toplevel

Since changing the smoothing nodes to be top level a few months ago, I hadn't noticed, but it seems that visibility from parent nodes is not propagated to top level nodes, and thus the smoothing nodes can't so easily be hidden except by hiding them explicitly.

This is kind of strange and it comes from the core source code, I'm trying to work out whether this is intentional in Godot (and should be fixed) or whether I should fix in the addon.

UPDATE:
Turns out the core CanvasItem visibility propagation is not propagated across toplevel nodes as of godotengine/godot#58870 .
This is presumably because the visibility in VisualServer is not inherited because they are parented to the toplevel node rather than the parent in the scene tree. But this means there is no notification for us to detect efficiently when the parent visibility has changed.

We might have to call is_visible_in_tree() every frame on the parent just in case it had changed. This is very inefficient.

Argg, this problem and the z sorting suggests it would be nicer to use the new use_identity_transform method for canvas items, but I only added this for core interpolation, and when that is available there is no need for the addon. 😆
Catch 22 situation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.