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

Expose CesiumSunSky date and time properties to Sequencer #761

Open
wants to merge 2 commits into
base: ue4-main
Choose a base branch
from

Conversation

argallegos
Copy link
Contributor

See #760 - Previously, you could not animate the date or time in Sequencer. This PR exposes CesiumSunSky's Solar Time, Day, Month, Year, and Time Zone parameters to Sequencer.

image

Note that currently, CesiumSunSky's UpdateSun function must be called every frame in order for the animation to reflect in the scene. The best way I could find around that was to add a Repeater Event Track on CesiumSunSky in the sequencer, then binding that event to UpdateSun. Steps to do that below, since I'm not sure where else to document them:

  1. Add CesiumSunSky to the Sequencer track
  2. Click the "+ Track" button and select Event>Repeater from the menu
  3. Double-click the new Event Track - it will create a new Sequence Director blueprint. Connect an Update Sun node to the event.
    image
  4. Keyframe your animation
  5. To make sure it's working, right click on the event track and select Properties>Call In Editor.

Of course, there's a lot that could be improved here - it would be great if people didn't have to add the event track. But I imagine that would involve refactoring the SunSky so this is probably enough for now.

@cesium-concierge
Copy link

Thanks for the pull request @argallegos!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

@xuelongmu
Copy link
Contributor

xuelongmu commented Feb 23, 2022

There's actually a way to trigger UFUNCTIONs when sequencer-exposed variables are animated on a sequencer track:
https://docs.unrealengine.com/4.26/en-US/AnimatingObjects/Sequencer/HowTo/GameplayAnimBlending/#2-animationandcharacterblueprintsetup
It would make the most sense to implement this in C++ (the principles are the same, you just have to name the setter function have a parameter interp). I can make the changes if that's convenient.

@argallegos
Copy link
Contributor Author

Thanks @xuelongmu, that would be great!

@cesium-concierge
Copy link

Thanks again for your contribution @argallegos!

No one has commented on this pull request in 30 days. Maintainers, can you review, merge or close to keep things tidy?

I'm going to re-bump this in 30 days. If you'd like me to stop, just comment with @cesium-concierge stop. If you want me to start again, just delete the comment.

@kring kring deleted the branch ue4-main April 1, 2022 02:48
@kring kring closed this Apr 1, 2022
@kring kring reopened this Apr 1, 2022
@kring kring changed the base branch from main to ue4-main April 1, 2022 03:07
@michalgryko
Copy link

Hi, I tried adding the interp specifiers to the CesiumSunSky script in UE5 to expose the properties but does not reveal them in the sequencer. Are there other changes required to make this work with UE5?

@kring
Copy link
Member

kring commented Sep 25, 2023

Adding Interp should work, but only if you recompile the plugin. Unreal won't automatically pick up code changes that you make to an Engine plugin. You can try copying the plugin to your project's Plugins directory instead.

@michalgryko
Copy link

Great thanks for advice!

@mylestec
Copy link

Hi... I'm a newb and so apologize for what is probably a stupid question: How does one find the CesiumSunSky script in UE5, find the interp code necessary to expose the parameter in the sequencer, add the interp code, and then recompile the plugin. Any help you can offer will be hugely appreciated!

@kring
Copy link
Member

kring commented Feb 15, 2024

If you've installed the plugin via the Epic Launcher, the code is usually found in C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\CesiumForUnreal or similar for your UE version. The necessary change is this this PR; see the Files Changed tab. This is an old PR, though, so the files will have changed in the meantime, so you may have to adapt accordingly. The easiest way to recompile the plugin is to add it to your project's Plugins directory (copy the entire CesiumForUnreal directory there) and then Unreal will compile it on load, as long as your project is a C++ project. Convert a Blueprint-only to a C++ project by adding a C++ source file to it from the UE Editor. You'll need Visual Studio.

@visualsounds
Copy link

If you've installed the plugin via the Epic Launcher, the code is usually found in C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace\CesiumForUnreal or similar for your UE version. The necessary change is this this PR; see the Files Changed tab. This is an old PR, though, so the files will have changed in the meantime, so you may have to adapt accordingly. The easiest way to recompile the plugin is to add it to your project's Plugins directory (copy the entire CesiumForUnreal directory there) and then Unreal will compile it on load, as long as your project is a C++ project. Convert a Blueprint-only to a C++ project by adding a C++ source file to it from the UE Editor. You'll need Visual Studio.

This is beyond me, could you elaborate with a step-by-step instruction on how to make this work in UE5.3?
I'd very much appreciate your help with this.

@kring
Copy link
Member

kring commented Mar 17, 2024

No, we can't provide more detailed instructions than what I've already provided. If you have specific questions we may be able to answer them. Otherwise, you'll have to wait until this is incorporated into an official version of the plugin.

@visualsounds
Copy link

visualsounds commented Mar 18, 2024

Thanks for the answers. My specific question is: Is this supposed to also work in UE 5.3.2? On the instructions, the screenshots are for 4.26.
I have followed every step, copied the plugin folder, installed Visual Studio, created a project in C++, added the event repeater and connected the UpdateSun node, but nothing for time/date in the CesiumSunSky sequencer shows up.

@kring
Copy link
Member

kring commented Mar 18, 2024

As far as I know, the approach in this PR should work in 5.3.2 as well, but I haven't tried it. You will have to drag the CesiumSunSky Actor into the Sequencer, though, just like anything else you want to manipulate with the Sequencer. If that doesn't help, I'm afraid I don't know what the problem might be, sorry.

@visualsounds
Copy link

Maybe I missed something, but what is the way to implement this PR?

@kring
Copy link
Member

kring commented Mar 25, 2024

Maybe I missed something, but what is the way to implement this PR?

Sorry, I don't understand your question.

@mathieuvannereux
Copy link

Hi, finally managed to add the Interp specifier to CesiumSun&Sky properties in C++ file in Visual Studio, then tried to recompile plugin by copying the entire CesiumForUnreal folder (directory C:\Program Files\Epic Games\UE_5.1\Engine\Plugins\Marketplace)
to my project's Plugins directory (C:\Program Files\Epic Games\UE_5.1\Engine\Plugins) but UE crash when I restart ... Error message : "The following modules are missing or built with a different engine version" ... Tried to download the game development C++ package along with the Visual Studio update and generate new Visual Studio project file but nothing works !

Starting to be a bit annoyed with all of these too complex settings :(

@kring
Copy link
Member

kring commented Jun 26, 2024

The following modules are missing or built with a different engine version

That's normal when you put the plugin in your project directory.

Tried to download the game development C++ package along with the Visual Studio update and generate new Visual Studio project file but nothing works !

I can't help you unless you tell me in what way it doesn't work.

Starting to be a bit annoyed with all of these too complex settings

Sorry you're having trouble, but keep in mind you're trying to make the plugin do something it isn't meant to do by modifying it. That's always going to have some complexity, especially if you're not used to working with C++ code bases and don't already have a development environment set up.

@mathieuvannereux
Copy link

Thank you for the following up Kevin. I understand that I'm trying to make the plugin do something it isn't meant to do. Hope there will be an update soon !

Once the CesiumforUnreal folder has been deplaced to Plugin folder, my uproject. don't open anymore. I have the "following modules are missing" error message and despite attempts to convert in C++ project (supposition found on forums) nothing works ... The only thing I can do is to trash the entire uproject and restart from zero

@azrogers
Copy link
Contributor

@mathieuvannereux First, try putting the CesiumForUnreal folder in your project's plugin folder, rather than your installed Unreal version's plugin folder. If your .uproject file is at C:/Dev/my-project, the plugin folder should be C:/Dev/my-project/Plugins/CesiumForUnreal. You might need to create the plugins folder if it doesn't exist already. Second, you're going to need to use Unreal 5.2 or newer, or revert to Cesium for Unreal 2.5.0 (the last version that supported Unreal 5.1). Third, try right-clicking on your uproject file and selecting "Generate Visual Studio project files" (you might need to click "Show more options" at the bottom of the right click menu first). This will create a .sln which you should open. At the top of the window, the three dropdowns next to the start button should be set to "DebugGame Editor," "Win64," and whatever your project name is. Now click the play button in Visual Studio ("Local Windows Debugger") to build and launch the editor.

@mathieuvannereux
Copy link

mathieuvannereux commented Jul 2, 2024

Capture d’écran 2024-07-02 162518
Thank you @azrogers for your reply ! As you can see attached, I don't have Plugin folder in my project folder. Maybe because I use Unreal 5.1 and Cesium 2.2.0, it's probably for this reason I don't get the same directory hierarchy. I'm going to update all these guys before trying to generate .sln file, and I come back to you later, I let you know further soon !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Interp specifier to CesiumSunSky to change date and time in Sequencer
9 participants