Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: texture mapping movement #2722

Open
wants to merge 20 commits into
base: dev
Choose a base branch
from

Conversation

AlejandroAlvarezMelucciDCL
Copy link
Collaborator

@AlejandroAlvarezMelucciDCL AlejandroAlvarezMelucciDCL commented Nov 5, 2024

Initiative Notion: https://www.notion.so/decentraland/Texture-mapping-movements-ex-UV-animations-5859b7d5d35f4b54be01767bf9845849

Related PRs:
Protocol PR: decentraland/protocol#230
SDK: decentraland/js-sdk-toolchain#1028

QA TEST STEPS

  1. Download this test scene and uncompress it somewhere
  2. Enter the scene root folder with a terminal/command and run npm i and then npm run start
  3. Close the Explorer that auto-opened. Leave the scene running in the console/terminal.
  4. Download the build from this PR and connect it to the running scene using the console command according to your OS
  5. The client should open and the scene should be shown
  6. The test scene has a red button to toggle the floor tiling on and off, going from (1,1) and (8,8)
    image
  7. Check the texture animation on the cubes and plane are playing.
  8. Press the button to toggle the floor tiling

@AlejandroAlvarezMelucciDCL AlejandroAlvarezMelucciDCL added the force-build Used to trigger a build on draft PR label Nov 6, 2024
@AlejandroAlvarezMelucciDCL AlejandroAlvarezMelucciDCL added force-build Used to trigger a build on draft PR and removed force-build Used to trigger a build on draft PR labels Nov 6, 2024
@AlejandroAlvarezMelucciDCL AlejandroAlvarezMelucciDCL added force-build Used to trigger a build on draft PR and removed force-build Used to trigger a build on draft PR labels Nov 8, 2024
@AlejandroAlvarezMelucciDCL AlejandroAlvarezMelucciDCL added force-build Used to trigger a build on draft PR and removed force-build Used to trigger a build on draft PR labels Nov 11, 2024
@AlejandroAlvarezMelucciDCL AlejandroAlvarezMelucciDCL added force-build Used to trigger a build on draft PR and removed force-build Used to trigger a build on draft PR labels Nov 11, 2024
@AlejandroAlvarezMelucciDCL AlejandroAlvarezMelucciDCL marked this pull request as ready for review November 18, 2024 01:34
@AlejandroAlvarezMelucciDCL AlejandroAlvarezMelucciDCL removed do not merge force-build Used to trigger a build on draft PR labels Nov 18, 2024
Copy link
Collaborator

@fcolarich fcolarich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!! left a small comment that you can disregard :)

Copy link
Collaborator

@DafGreco DafGreco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation checked on both platforms Windows and Macos ✅

public abstract void UpdateSDKTransform(ref SDKTransform sdkTransform);
public abstract void UpdateTransform(Transform transform);

public virtual void UpdateSDKTransform(ref SDKTransform sdkTransform) { }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its a good opportunity to remove these three methods (UpdateSDKTransform, UpdateTransform and UpdateMaterial) from the interface.
If we continue down this path, any new thing that we want to tween (IE: bones or UI) would need to be added to the interface as virtual.
We could think of doing extensions methods for ICustomTweener. Please ping me when available and we can walk trough it together

@@ -88,6 +88,32 @@ public override void UpdateTransform(Transform transform)
{
transform.localRotation = currentValue;
}
}

public class TextureMoveTweener : CustomTweener<Vector2, VectorOptions>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing the change mentioned above, this is going to be just a Vector2 tweener, that can be reused in UI for example; and not hardly bound to textures


if (pbTween.ModeCase == PBTween.ModeOneofCase.TextureMove)
{
var sdkTweenTextureComponent = new SDKTweenTextureComponent(pbTween.TextureMove.MovementType);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure this component adds value. PBTween is in the entity, you can still use it when you got to determine the texture tween type.
Please check if this component can be deleted, and you can keep the creation of tweens branching free

@@ -30,7 +30,7 @@ public class TweenUpdaterSystemShould : UnitySystemTestBase<TweenUpdaterSystem>
public void SetUp()
{
tweneerPool = new TweenerPool();
system = new TweenUpdaterSystem(world, Substitute.For<IECSToCRDTWriter>(), tweneerPool, null, Substitute.For<SceneStateProvider>());
system = new TweenUpdaterSystem(world, Substitute.For<IECSToCRDTWriter>(), tweneerPool, Substitute.For<SceneStateProvider>());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you take the opportunity and do a test on the texture mapping feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a new feature
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants