x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

SColorGradientEditor does not trigger OnCurveChanged events.

Hello; I am looking through your ramp implementation. SCurveEditor, class which is used for float ramps, seems to trigger OnCurveChanged events for the underlying curve; however SColorGradientEditor (constructed by SCurveEditor) seems to be missing calls to these (when creating and manipulating color curve keys). For the calls it does not intercept, curve manipulation events come through (like right mouse click). But for other ones, no go.

Thanks.

PS. I tagged this as 4.11, but this is present in previous versions as well.

Product Version: UE 4.11 Preview
Tags:
more ▼

asked Feb 23 '16 at 07:55 PM in Bug Reports

avatar image

ttvd
333 20 25 34

avatar image Sean L ♦♦ STAFF Feb 24 '16 at 07:37 PM

Hello,

Which files are you looking at? We found the SCurveEditor.h and the Gradient Viewer variable which is a TSharedPtr to the SColorGradientEditor. Other than GetColorGradientVisibility, this is the only reference to Color Gradient in SCurveEditor.cpp. Let me know exactly what you are trying to accomplish?

avatar image ttvd Feb 24 '16 at 07:55 PM

Hello,

Basically, when you create UCurveFloat and assign it to SCurveEditor, then it uses the regular curve editor widget and does not use SColorGradientEditor TSharedPtr (well it's created there, but it's not used in this case). Mouse events in SCurveEditor will change the curve and will trigger OnCurveChanged calls in UCurveFloat .

SColorGradientEditor is in SColorGradientEditor.h; if you create UCurveLinearColor and assign it to SCurveEditor widget, it will use SColorGradientEditor. Mouse events in SColorGradientEditor will change the curve and will not trigger OnCurveChanged calls. I am pretty sure this is not the intention?

I am trying to get OnCurveChanged callbacks for my curve objects when they are operated on by curve editor widgets. I only get them fired for UCurveFloat but not for UCurveLinearColor .

Thanks!

avatar image Sean L ♦♦ STAFF Feb 24 '16 at 08:18 PM

Thank you for providing the additional information.

Could you provide the code that you are working with?

avatar image ttvd Feb 24 '16 at 10:49 PM

Sure!

https://github.com/sideeffects/HoudiniEngineForUnreal/blob/Houdini15.0-Unreal4.10/Source/HoudiniEngineRuntime/Private/HoudiniAssetParameterRamp.h

and

https://github.com/sideeffects/HoudiniEngineForUnreal/blob/Houdini15.0-Unreal4.10/Source/HoudiniEngineRuntime/Private/HoudiniAssetParameterRamp.cpp

OnCurveChanged are fired for UHoudiniAssetParameterRampCurveFloat (derivative of UCurveFloat) but not for UHoudiniAssetParameterRampCurveColor (derivative of UCurveLinearColor).

SCurveEditor does have calls to OnCurveChanged on curve key modifications and SColorGradientEditor doesn't. Events that don't go through to SColorGradientEditor from SCurveEditor (like right mouse click) will generate OnCurveChanged on UCurveLinearColor.

SColorGradientEditor curve modification will however call Modify for each curve key operation and will generate undo/redo transactions. My solution at the moment is to override Modify for UCurveLinearColor derivative, detect that undo transaction is in process and spin until transaction is active; once it is not active, I can take care of curve modification. Horrible solution, but that's the only thing I could think of.

Thanks.

avatar image Sean L ♦♦ STAFF Feb 25 '16 at 07:47 PM

I apologize for the continued back and forth, this is an aspect of the engine I'm not yet familiar with. If I am following correctly, you are saying that:

A class based on UCurveFloat will trigger OnCurveChanged correct

A class based on UCurveLinearColor will not trigger

What exactly is HoudiniAssetParameterMultiparm? the HoudiniAssetParameterRamp class is based on this but I'm not sure where it derives from.

I'm also not sure I understand where SCurveEditor & SColorGradientEditor come into play. In the code you provided SCurveEditor does not mention OnCurveChanged and I'm not able to find a reference to the SColorGradientEditor class.

Would it be possible to provide steps that I can follow to setup a test locally or provide a smaller class/project that only has changes related to how you are using OnCurveChanged?

avatar image ttvd Feb 25 '16 at 08:35 PM

SCurveEditor has member CurveOwner (set with SCurveEditor::SetCurveOwner). Look inside SCurveEditor implementation for CurveOwner->OnCurveChanged calls. These calls are made on curve key events.

Now SCurveEditor::SetCurveOwner also forwards SetCurveOwner to GradientViewer member (type SColorGradientEditor). That's the TSharedPtr.

Now look inside SColorGradientEditor.cpp; none of the curve key events have CurveOwner->OnCurveChanged calls, they are not there.

So basically OnCurveChanged events are not triggered for your color ramps.

I guess that's a bug. You are correct that UCurveFloat will trigger OnCurveChanged, since SColorGradientEditor member is not used in this case (mouse events are not routed to that widget) and are handled by SCurveEditor, so OnCurveChanged are made.

My code just shows what I expect and a use case. Sorry for confusion. Also I appreciate the help.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hello,

I have entered a bug report for your issue (UE-27507). Thank you for your report and for providing the necessary clarification on this issue. I will provide updates on this as they become available.

Have a great day

more ▼

answered Feb 26 '16 at 02:06 PM

avatar image

Sean L ♦♦ STAFF
43.8k 485 152 440

avatar image ttvd Feb 26 '16 at 03:46 PM

Awesome, thanks Sean.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question