GLTF Import Export

User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: GLTF Import Export

Post by clintonman »

trueBlue wrote: 20 Nov 2023, 19:26 Post Load Skel Binding Parent Dev script needs: params.SetTerminationFlag()

Code: Select all

	if(importedActorNames == "")

params.SetTerminationFlag()
	return;
Roger that, thanks.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: GLTF Import Export

Post by clintonman »

The "final" fix is in. It can export actors that have more than 1 mesh.
The problem was that there are 2 types of skinning and the sdk was giving a bad piece of information with one type.
The fix was to get the skinning for the meshes via script and transfer that data over to the plugin.

I think there should be a new release this weekend. :D
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: GLTF Import Export

Post by clintonman »

LightingLargeFlatSurfaces2.jpg
The only difference between left and right is that the right image has the walls, floor and ceiling subdivided. This was giving me trouble while trying to work out the lights import and export values. You have to have more geometry on large flat surfaces to get good lighting.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: GLTF Import Export

Post by trueBlue »

Latest version is looking and working pretty good! :bananathumb:
Love the Open File Location! :D
Here is a Female Avatar scene
90 frame animation moving the arms down and up
Also added Keyframes using the Eyes L & R morph moving the eyes left and back to looking straight ahead
Exported and then Imported
I used Bind Nodes and then Apply Morphs
Got an error
From the Rosetta.log:
04:51:03.841 INFO GLTF Import - 3765 ms 0x00000000 [RsCommandMng.cpp(84)]
04:51:03.841 INFO Transition Command - 3765 ms 0x00000000 [RsCommandMng.cpp(84)]
04:51:10.983 INFO Transition Command - 6859 ms 0x00000000 [RsCommandMng.cpp(84)]
04:51:33.971 INFO Transition Command - 2906 ms 0x00000000 [RsCommandMng.cpp(84)]
04:51:37.331 INFO MeshModifiers.OpenMeshEditorPanel('/Project/Avatar Female/body_skin/body/Vertex morphs',1,3,1); - 31 ms 0x00000000 [RsSysCore.cpp(700)]
04:51:37.519 INFO MeshModifiers.OpenMeshEditorPanel('/Project/Avatar Female/body_skin/body/Vertex morphs',1,3,1); - 62 ms 0x00000000 [RsSysCore.cpp(700)]
04:51:37.925 ERR Source object: /Scripts/CustomCommands/GLTFgroup/set keyframes Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 132, Char: 4 Script text: Node.Value(firstSel + "/Vertex morphs", keyname) = weight; IMPORTANT - if the above mentioned command is accessing any function set, the error line above may refer to the function set code, instead of command code! 0x80020101 [RcScriptCmd.cpp(1170)]
No Errors listed in the Import Options
I then used Skinn Actors, Anim to Actors, Convert Nulls, and Cleanup
Results:
90 frame animation moving the arms down and up
Removed the new in-between keyframe
chest moves a little bit
moving the eyes right and left is missing
Attachments
Avatar Female.RsScn
(1.99 MiB) Downloaded 35 times
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: GLTF Import Export

Post by clintonman »

trueBlue wrote: 29 Nov 2023, 13:23 Latest version is looking and working pretty good! :bananathumb:
Love the Open File Location! :D
Here is a Female Avatar scene
90 frame animation moving the arms down and up
Also added Keyframes using the Eyes L & R morph moving the eyes left and back to looking straight ahead
Exported and then Imported
I used Bind Nodes and then Apply Morphs
Got an error
From the Rosetta.log:
04:51:03.841 INFO GLTF Import - 3765 ms 0x00000000 [RsCommandMng.cpp(84)]
04:51:03.841 INFO Transition Command - 3765 ms 0x00000000 [RsCommandMng.cpp(84)]
04:51:10.983 INFO Transition Command - 6859 ms 0x00000000 [RsCommandMng.cpp(84)]
04:51:33.971 INFO Transition Command - 2906 ms 0x00000000 [RsCommandMng.cpp(84)]
04:51:37.331 INFO MeshModifiers.OpenMeshEditorPanel('/Project/Avatar Female/body_skin/body/Vertex morphs',1,3,1); - 31 ms 0x00000000 [RsSysCore.cpp(700)]
04:51:37.519 INFO MeshModifiers.OpenMeshEditorPanel('/Project/Avatar Female/body_skin/body/Vertex morphs',1,3,1); - 62 ms 0x00000000 [RsSysCore.cpp(700)]
04:51:37.925 ERR Source object: /Scripts/CustomCommands/GLTFgroup/set keyframes Error: Microsoft JScript runtime error Description: Invalid procedure call or argument Error code: 0x800a0005 - (null) Line: 132, Char: 4 Script text: Node.Value(firstSel + "/Vertex morphs", keyname) = weight; IMPORTANT - if the above mentioned command is accessing any function set, the error line above may refer to the function set code, instead of command code! 0x80020101 [RcScriptCmd.cpp(1170)]
No Errors listed in the Import Options
I then used Skinn Actors, Anim to Actors, Convert Nulls, and Cleanup
Results:
90 frame animation moving the arms down and up
Removed the new in-between keyframe
chest moves a little bit
moving the eyes right and left is missing
It looks like the morph animation needs some work.
With glTF all the mesh morphs are animated at the same time, like the tS matrix animates tx,ty,tz,yaw, roll, pitch etc all together, so either need to require all morphs for the mesh are animated or some way to add zeros to the gltf file morph animations for the non-animated morphs.

Already fixed one problem with the animation names, the actor has names like "head/Vertex morphs/P - Jaw". If it wasn't an actor it would just be "Vertex morphs/P - Jaw" without the need for the mesh name at the front. Without it the body and head morphs were getting mixed up.

After fixing that and adding animation keys to all the morphs for testing I discovered that the morphs aren't matching up. I got the morph animation to export, but instead of the animated eyes I got an animated mouth. So the plugin needs to do something to match up the morphs in the exported file.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: GLTF Import Export

Post by trueBlue »

I do not have very much experience with Morphs and I had a heck of a time just adding the Eyes Morph to the animation
At first, it was not even working, but I eventually I got it to work
It seems like it got baked into one of the AnimClips
It looks like it failed (error) on the body morphs, in with which I did not add to the animation

Wonder if I add another Clip just for the Eye Morph, it would have made a difference

Stil, if I do not Import the Morphs, the two clips have extra keyframes that make the arms drift, which is not in the original animation
Also, her bobbies move, which is not in the original animation :lol:
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: GLTF Import Export

Post by clintonman »

Fixed plugin code and got the morph animation to export to the correct morph. The change was surprisingly small but it did take a while to figure it out. Also found that the morph animations were being exported for disabled clips and fixed that.
Last fix for morphs will be to default morph animation values to zero for non-animated morphs of the mesh. If cannot then it will be required to set key frames for all morphs. An all or nothing situation.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5432
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: GLTF Import Export

Post by clintonman »

GLTF_fullsizetextures.jpg
ABeautifulGame sample with full 2k textures

I decided to give the 4GB Patch someone mentioned in another thread a go on the Rosetta.exe file

Now the gltf importer will import the chess board sample without crashing. There was a fairly long delay before the model showed in the viewport.

Goes without saying, but use at your own risk.

Link for the patch is here:

https://ntcore.com/?page_id=371
Clinton Reese

http://clintons3d.com
Post Reply