- Post your Feature Requests in this thread -

Vote for new features, or make your own requests here.
fiasko
Posts: 2
Joined: Mon Jan 06, 2025 9:31 pm

Re: - Post your Feature Requests in this thread -

Post by fiasko »

Hi there,

I'm using ArticulationBodies and one of the properties that I'd like to store is of type "ArticulationReducedSpace" (jointVelocity and jointPosition). If saved at the moment, only the degrees of freedom are saved:

Code: Select all

{"dofCount": 1}
but not the actual data.

You can replicate this by adding a ArticulationBody to a Cube and add another cube as a child and setting the child ArticulationBody to anything but "FixedJoint". Then, check auto-save for the ArticulationBody and save jointVelocity and jointPosition properties. In the json, you'll only see the dofCount as mentioned above.

I worked around this by adding a ES3UserType_ArticulationBody and also a ES3Type_ArticulationReducedSpace. So now I can do this:

Code: Select all

writer.WriteProperty("jointPosition", instance.jointPosition, ES3Type_ArticulationReducedSpace.Instance);
writer.WriteProperty("jointVelocity", instance.jointVelocity, ES3Type_ArticulationReducedSpace.Instance);
Having to add some extra code for the ArticulationBody is fine for me, because I also need to do some custom stuff when loading, but I think the implementation for storing ArticulationReducedSpace is much better in your hands.

So my feature request would be to provide the implementation from your side. I added my naive implementation to the post in hoping you'll improve on that with best practices. :)

Thanks for the great asset.. I've been through all the serialization/deserialization myself and it worked, but your code is saving so much time and hassle for me! I'm really happy!
Attachments
ES3Type_ArticulationReducedSpace.cs
(2.47 KiB) Downloaded 84 times
User avatar
Joel
Moodkie Staff
Posts: 5069
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

fiasko wrote: Tue Jan 07, 2025 5:58 pm Hi there,

I'm using ArticulationBodies and one of the properties that I'd like to store is of type "ArticulationReducedSpace" (jointVelocity and jointPosition). If saved at the moment, only the degrees of freedom are saved:

Code: Select all

{"dofCount": 1}
but not the actual data.

You can replicate this by adding a ArticulationBody to a Cube and add another cube as a child and setting the child ArticulationBody to anything but "FixedJoint". Then, check auto-save for the ArticulationBody and save jointVelocity and jointPosition properties. In the json, you'll only see the dofCount as mentioned above.

I worked around this by adding a ES3UserType_ArticulationBody and also a ES3Type_ArticulationReducedSpace. So now I can do this:

Code: Select all

writer.WriteProperty("jointPosition", instance.jointPosition, ES3Type_ArticulationReducedSpace.Instance);
writer.WriteProperty("jointVelocity", instance.jointVelocity, ES3Type_ArticulationReducedSpace.Instance);
Having to add some extra code for the ArticulationBody is fine for me, because I also need to do some custom stuff when loading, but I think the implementation for storing ArticulationReducedSpace is much better in your hands.

So my feature request would be to provide the implementation from your side. I added my naive implementation to the post in hoping you'll improve on that with best practices. :)

Thanks for the great asset.. I've been through all the serialization/deserialization myself and it worked, but your code is saving so much time and hassle for me! I'm really happy!
Many thanks, I've added a request for this here:
https://moodkie.com/forum/viewtopic.php?t=3130

Also your ES3Type looks really good, the only change I'd make would be to throw an InvalidDataException rather a plain Exception and add a more descriptive message, but this is a very minor amendment.

Also one change you might want to make at your end is to rename it from ES3Type_ to ES3UserType_ so that it doesn't conflict when official support is added to Easy Save (unless you've added it to Plugins/Easy Save 3/Scripts/Types/Unity Types/, in which case it'll be overwritten without any issues).

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply