question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow creation of effects without setting them

See original GitHub issue

While 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:open
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Sharparamcommented, Jul 4, 2016

For setting a GUID, we already have the method SetGuid for that (IDevice). Maybe it’s worth adding an overload to SetEffect 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 of IDevice).

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 existing Set* methods that will create the effect and return its GUID, but not actually pass them to the internal SetEffect 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.

0reactions
Sharparamcommented, Mar 11, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found