Answered

Update custom property of component in edit mode

Alexandre Stroukoff 3 weeks ago updated by Peter - Soxware Developer 3 weeks ago 2

Hello !

I have an script on the same object that has an animator component, with a public float property, im going to call it X

in my uMotion project, i create a custom property, that controls this value X. I can now key it, and it export fine and the value is properly animated in the .anim file.

however my issue is : the value is not being updated while im editing my animation in edit mode. i tried printing the value X with a callback, and i can see the callback being fired but the X value never change regardless of what i do while editing my animation. 


This value is used to drive the offset of a texture in a material and i would love to be able to preview it while animating ! It technicaly works but im animating blindy


thank you, i love umotion !

UMotion Version:
1.22
Unity Version:
2019.3 URP

Answer

Answer
Answered

Hi Alexandre,

thank you very much for reaching out.

Please ensure that the "Preview" toggle is enabled in your custom property constraint settings:

In case this doesn't help, may I ask you to send me a unitypackage that includes just everything I need to reproduce your situation (i.e. your UMotion project, the related script and the related character)? You can send it to me via the email support form (or request a link to my Dropbox via email in case the file size is too big).


Btw. if you want you can animate the textures offset directly with a custom property constraint (no need for a custom script):

Best regards,
Peter

GOOD, I'M SATISFIED

Hey, thanks a lot for the fast answer !

As i was rebuilding the example from scratch it worked it the end, so i might have an issue on my other project (could be URP not updating the material correctly) but the Umotion side is working perfectly thanks for your help !

Just for info, i didnt want to go with updating the offset, with a script i can have a larger slider range (i.e 0-100), that makes its so much easier to select one sprite ! I will also probably separated eyes, mouth, etc with different controls.


I would be curious to know if you can think of easiers way to do this (a int slider would be great :D )

Here is what it looks like : 

Satisfaction mark by Alexandre Stroukoff 3 weeks ago
Answer
Answered

Hi Alexandre,

thank you very much for reaching out.

Please ensure that the "Preview" toggle is enabled in your custom property constraint settings:

In case this doesn't help, may I ask you to send me a unitypackage that includes just everything I need to reproduce your situation (i.e. your UMotion project, the related script and the related character)? You can send it to me via the email support form (or request a link to my Dropbox via email in case the file size is too big).


Btw. if you want you can animate the textures offset directly with a custom property constraint (no need for a custom script):

Best regards,
Peter

I'm glad to hear that you've been able to find a solution for your issue.

I would be curious to know if you can think of easiers way to do this (a int slider would be great :D )

The way you approach this right now is the best I can currently think of. Regarding the int slider, I've took a note on my "ideas for the future" list, but can't promise anything as of right now.

Best regards,

Peter