Allow creation of effects without setting them
See original GitHub issueWhile Colore is great cause of the many Helper Methods (like SetCustom…) I think the base Methods of the SDK should be public and similar to the C++ implementation to not confuse people. This allows for easier porting of existing C++ or C# code to the other language.
It also allows more advantage use of storing and retriving frames with CreateEffect and SetEffect(guid).
That means:
- Create(Device)Effect should be made available to the public as a method under each Device and have a way to pass NULL as ref which seems to directly apply the effect after creation as seen in the Chroma Sample SDK App.
- SetEffect should accept a GUID instead of an Effect(Type).
- … more(?)
Your thoughts about this?
Possible implementation 1. Guid passed as out as in the Chroma SDK.:
# Get GUID and Apply
var custom = Custom.Create();
custom.Set(Color.Red);
Guid guid;
Chroma.Instance.Keyboard.CreateEffect(Corale.Colore.Razer.Keyboard.Effects.Effect.Custom, custom, out guid);
if (guid != Guid.Empty) Chroma.Instance.Keyboard.SetEffect(guid);
# Apply directly
var custom2 = Custom.Create();
custom2.Set(Color.Blue);
Chroma.Instance.Keyboard.CreateEffect(Corale.Colore.Razer.Keyboard.Effects.Effect.Custom, custom2);
Possible implementation 2. CreateEffect with additional parameter for applying instead of returning Guid:
# Get GUID and Apply
var custom = Custom.Create();
custom.Set(Color.Red);
var guid = Chroma.Instance.Keyboard.CreateEffect(Corale.Colore.Razer.Keyboard.Effects.Effect.Custom, custom);
if (guid != Guid.Empty) Chroma.Instance.Keyboard.SetEffect(guid);
# Apply directly
var custom2 = Custom.Create();
custom2.Set(Color.Blue);
Chroma.Instance.Keyboard.CreateEffect(Corale.Colore.Razer.Keyboard.Effects.Effect.Custom, custom2, true);
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
After Effects Composition basics | Adobe
Right-click (Windows) or Control-click (macOS) composition in the Project panel or Composition panel (not on a layer), and choose Composition ...
Read more >Setting preferences in After Effects
To reset background preferences, follow these steps: macOS. Go to your desktop and select GO on the menu bar.
Read more >Effects
Effects | TikTok Help Center. ... Tap on the recording screen and begin creating your video! Adding effects to your Favorites allows you...
Read more >How to Set Keyframes in After Effects
In this article, we provide a step-by-step guide to creating and setting keyframes in After Effects.
Read more >Law of effect
Thorndike's law of effect refutes the ideas George Romanes' book Animal Intelligence, stating that anecdotal evidence is weak and is typically not useful....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For setting a GUID, we already have the method
SetGuid
for that (IDevice
). Maybe it’s worth adding an overload toSetEffect
that takes a Guid to mimic the SDK endpoints.For directly applying the effect, we already have the normal methods which do just that (and the GUID of the created effect can be retrieved with the
CurrentEffectId
property ofIDevice
).As for how to do effect creation while not actually setting the effect, we’ll need some discussion on how to best implement it.
The most sensible might be to add
Create*
methods alongside the existingSet*
methods that will create the effect and return its GUID, but not actually pass them to the internalSetEffect
SDK endpoint.The only worry is that we’d be effectively doubling the amount of methods for every device class, making them quite large. Maybe it’s possible to put the creation logic in the effect struct themselves, meaning it would be something like:
new Static(Color.Blue).Id
.Moving this to v6.1 milestone. We’ll probably put in the
Create*
methods on each device for obtaining effect GUIDs without setting them, at least to begin with.