Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[URP 12] Bad importing of CollisionShapes for JSONs 1.20.1822.1 #49

Open
BrianAmadori opened this issue Aug 17, 2023 · 12 comments
Open

Comments

@BrianAmadori
Copy link

In 1.20 we have:

            "FatherJackV2": {
                "Generation": "RL_CC3_Plus",
                "Physics": {
                    "Shadow_Catcher": {},
                    "Preview_Camera": {},
                    "Father_Jack": {
                        "Collision Shapes": {
                            "CC_Base_Hip": {

                            },
                            ...

In 1.10, however, the Physics / Collision Shapes hierarchy is reversed:

        "Object": {
            "David": {
                "Generation": "",
                "Physics": {
                    "Collision Shapes": {
                         "CC_Base_Hip": {
                         ... 
                         }, 
                         "Misc": { }
                    }

The current parser is only supporting the 1.10 model, 1.20 fails and no colliders nor cloth is generated. For me, this currently means that CC3+ characters cannot get working clothes.

I suspect there are more changes because JSON schema versioning is just not supported at all in the source code.

@BrianAmadori
Copy link
Author

Offending code in Physics.cs:

        private void ReadPhysicsJson(QuickJSON physicsJson, QuickJSON characterJson)
        {
            QuickJSON shapesJson = physicsJson.GetObjectAtPath("Collision Shapes");
            QuickJSON softPhysicsJson = physicsJson.GetObjectAtPath("Soft Physics/Meshes");            
            
            if (shapesJson != null)
            { 
                ....

@soupday
Copy link
Owner

soupday commented Aug 17, 2023

What's exporting JSON version 1.20?

CC4.31 / iC8.31 only ever export 1.10. (at least to Unity & Blender)

@BrianAmadori
Copy link
Author

I am just producing an FBX via the export route.

image

@BrianAmadori
Copy link
Author

image

@BrianAmadori
Copy link
Author

i'm starting to suspect that the json export have changed in a very recent version. I'm re-exporting old-characters and now all of them have the new json format.

@soupday
Copy link
Owner

soupday commented Aug 17, 2023

I'm on the same version and everything is still 1.10.

Have you installed any add-ons (from the reallusion hub or otherwise) to CC4 or iClone recently? (iClone and CC4 share some functionality) I'm wondering if something there could have 'upgraded' the json export.

@BrianAmadori
Copy link
Author

BrianAmadori commented Aug 17, 2023 via email

@BrianAmadori
Copy link
Author

Well... this is weird as hell. I restarted CC4 and...

  • Tried to load an example project and export it, it exported with 1.10
  • Tried to toggle some features, first i added some morphs from the realistic morphs pack. Still 1.10
  • Tried to add some skingen stuff. Still 1.10.
  • Loaded a character of mine from a few days ago that I didn't touch since. Still 1.10.
  • Tried toggling on/off some exporting options, like texture baking, export pose vs calibration, etc. Still 1.10
  • Now i said... well, wth, let's try with the original model with the issue. I loaded it, NOW IT EXPORTED IT AS v1.10.

So, I wasted all my day with this issue, now it fixed itself and I don't have a way to reproduce it again. I swear that my sanity is OK.

@soupday
Copy link
Owner

soupday commented Aug 17, 2023

I think I can reproduce it:

Did you by any chance accidentally export a character to Maya first. (Exports to Maya use version 1.20.)
Any subsequent exports after that even if you change the target to something else are locked to 1.20.

As this is quite easy to do by accident, I think I may need to add a warning message that the JSON is wrong if it detects version 1.20.

This might also explain some odd import results some people report, where the character looks like it was exported with the wrong target even though they are sure it was for Unity.

@soupday
Copy link
Owner

soupday commented Aug 17, 2023

Or if it's not too much effort, I'll just have it parse version 1.20 correctly, then it won't matter.

@BrianAmadori
Copy link
Author

Oh, good call, that makes total sense.

I just tried to export a character with Maya target, and then with Unity3D hoping that i'd get stuck with the 1.20, but the behaviour was correct. I wonder if after an entire day of work without closing the app it glitched out somehow.

You can try to parse 1.20, but maybe a cheaper fix is to just throw a log error with the recommendation of changing targets and restart CC / iC if the version keeps being wrong?

@soupday
Copy link
Owner

soupday commented Aug 18, 2023

In all honesty it is less effort just to make it work with 1.20 than having to explain over and over that this is bug and how to fix it.

And you'd be surprised at how many people just completely ignore the console logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants