Posted: 17th Dec 2021 22:12
Ok so most all applications now load and support key morphing keys exported from like example blender. aka Shape Keys

Unreal supports it and unity 3d and 3ds max and blender and most all applications.

I ask that if app game kit is going to be taken more seriously that the team make it a add on.

It is a sad thing to know that a simple thing that most apps and game engines support does not.

So I ask, please make a add on for key morphing.
Posted: 17th Dec 2021 23:16
Hi
Perhaps no add on for that, but you could use memblock to get morphing with...
+ Code Snippet
CreateMemblockFromObjectMesh

Now it's a bit late....if you want I'll do an example this weekend.
Posted: 17th Dec 2021 23:21
Now it's a bit late....if you want I'll do an example this weekend.


That would be great, something this platform needs.
Posted: 18th Dec 2021 12:17
Ok ...here we are

Morphing is an old technique that moves vertex to match next figure . We could make a function ....something like an add on to morph differents keys of a figure. In the past it was absolutely necesary that both figures had the same quantity of vertex to work ...I've seen somewhere advanced programms that this is not necesary, but in this example I show you the old school technique .
In this example, you can flay with cursor keys to get closer to the object to see how vertes move to match the othe figure .

+ Code Snippet
// Project: 3D Morfing 
// Created: 2018-12-24

// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "3D Morfing" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts


`LOADING TWO POSE KEYS ...we could load more morphing keys but for this example is ok
loadobject(1000,"pose2.x")      `first pose key
loadobject(2000,"pose1.x")      `second pose  key
cloneobject(3000,2000)          `last pose key
loadimage(1,"face.png")
SetObjectVisible(2000,0)        `hiding second pose
setobjectimage(1000,1,0)
setobjectimage(3000,1,0)


mesh = CreateMemblockFromObjectMesh(1000,1)
`getting object vertex quantity of the model to manage vertex data
verts1= GetMemblockInt( mesh, 0 )
ob=0
for i = 0  to verts1-1
     inc ob
 	 x#=GetMeshMemblockVertexX(mesh,i)
	 y#=GetMeshMemblockVertexy(mesh,i)
	 z#=GetMeshMemblockVertexz(mesh,i)
	 createobjectbox(ob,1,1,1)        `we make litle boxes as vertex just to show vertex position and transformation
	 setobjectcolor(ob,255,0,0,0)
	 setobjectposition(ob,x#,y#,z#)
	 setobjectvisible(ob,1)            `WE CAN DEACTIVATE VERTEX VISIBILITY IN FINAL CODE
next

se=ob
mesh = CreateMemblockFromObjectMesh(2000,1)
verts2= GetMemblockInt( mesh, 0 )
for i = 0  to verts2-1
     inc se
 	 x#=GetMeshMemblockVertexX(mesh,i)
	 y#=GetMeshMemblockVertexy(mesh,i)
	 z#=GetMeshMemblockVertexz(mesh,i)
	 createobjectbox(se,1,1,1)
	 setobjectcolor(se,0,0,255,0)
	 setobjectposition(se ,x#,y#,z#)
	 setobjectvisible(se,1)            `WE CAN DEACTIVATE VERTEX VISIBILITY IN FINAL CODE
next

setcameraposition(1,100,0,-250)
SetCameraLookAt(1,100,0,0,0)

`sky	
createobjectsphere(5000,1000,10,10)
SetObjectColorEmissive(5000,0,0,50)
SetObjectCullMode(5000,0)	

do

gosub camara

`comparing vertex of first pose and second pose
for i= 1 to verts
	x#=getobjectx(i)     `first pose x
	y#=getobjecty(i)     `first pose y
	z#=getobjectz(i)     `first pose z

	nx#=getobjectx(i+verts)  `second pose x
	ny#=getobjecty(i+verts)  `second pose y
	nz#=getobjectz(i+verts)  `second pose z

`if vertex do not match, they move until they match when we press Spacebar

	if ( GetRawKeyState( 32 ) ) 
		if x#>nx# then moveobjectlocalx( i+verts,0.1)
		if x#<nx# then moveobjectlocalx( i+verts,-0.1 )
		if y#>ny# then moveobjectlocaly(i+verts,0.1)
		if y#<ny# then moveobjectlocaly(i+verts,-0.1)
		if z#>nz# then moveobjectlocalz( i+verts,0.1)
		if z#<nz# then moveobjectlocalz( i+verts,-0.1)
	endif

next

mesh = CreateMemblockFromObjectMesh(3000,1)
`getting object vertex quantity
 verts= GetMemblockInt( mesh, 0 )

    for i = 0  to verts-1
		 x#=Getobjectx(i+1+verts)
	     y#=getobjecty(i+1+verts)
	     z#=getobjectz(i+1+verts)
         SetMeshMemblockVertexPosition(mesh,i,150+x#,y#,z#) `we add here 150+ x# just to show differences between the two figures
    next
 //fixing mesh
SetObjectMeshFromMemblock(3000,1,mesh)


   print ("Fly with cursor and mouse ")
   print ("When ready press Sapcebar to see the morphing")
    Sync()
loop

camara:
	 if ( GetRawKeyState( 38 ) ) then MoveCameraLocalZ( 1, 3 )  
	 if ( GetRawKeyState( 40 ) ) then MoveCameraLocalZ( 1, -3 ) 
	 if ( GetRawKeyState( 37 ) ) then MoveCameraLocalX( 1, -3 ) 
	 if ( GetRawKeyState( 39 ) ) then MoveCameraLocalX( 1, 3 ) 

	 if ( GetPointerPressed() )
		startx# = GetPointerX()
		starty# = GetPointerY()
		angx# = GetCameraAngleX(1)
		angy# = GetCameraAngleY(1)
		pressed = 1
	 endif

	 if ( GetPointerState() = 1 )
		fDiffX# = (GetPointerX() - startx#)/1.0
		fDiffY# = (GetPointerY() - starty#)/1.0

		newX# = angx# + fDiffY#
		if ( newX# > 89 ) then newX# = 89
		if ( newX# < -89 ) then newX# = -89
		SetCameraRotation( 1, newX#, angy# + fDiffX#, 0 )
	 endif
return





Posted: 18th Dec 2021 13:05
So I guess it can be done with a exhausting way.

Good job and great example.

I just wish they will implement this and make it easer to apply automatically.

I have like 30 different shape keys in one mesh.

But you proved it possible so now I know they could add support for shape keys.
Posted: 18th Dec 2021 13:09
But you proved it possible so now I know they could add support for shape keys.


Yeah....I have fun doing things by myself
Posted: 18th Dec 2021 13:15
I have fun doing things by myself


I wish I had that sort of time just for shape keys lol.
Posted: 18th Dec 2021 13:18
You will find help here in the forum....just ask your doubts .
Edit : you can animate your object with all the meshes instead of morphing....that is even easier
Posted: 18th Dec 2021 13:27
you can animate your object with all the meshes instead of morphing....that is even easier


Oh I'm sorry

I have a fully animated model but the face is animated by shape keys

it is the face like in your demo that I need the keys from blender.

The shape keys work in everything but app game kit.

lol that was fun to look at
Posted: 18th Dec 2021 13:33
he shape keys work in everything but app game kit.


Ok...ok .... just trying to find a solution... this the way old school made the trick .

Cheers.
Posted: 19th Dec 2021 0:22
this the way old school made the trick


Yes, and thank you so much for showing me.

I can not use it for my shape keys but I can use this for other stuff.