Clone info hierachy - Script - For gLTF export in R20


#1

Once upon a time, our very own Oscar winning genius Per Anders made a cool little script called Clone_Info_hierarchy.c4D.
It essentially took your cloner object and replicated what was happening with nulls.

I’m sure some of you are familiar.

Seems somebody made an update to this script, to work with Python in the absence of C.O.V.F.E.F.E :wink:

It works fine, but sadly it replicates the cloner as a set of still objects.
The original Clone_Info_hierarchy.C4D would match the object PSR as animation, which is something I could then output to an AR platform via the gLTF exporter (Also R20 only), as is my current goal.

Per’s old script could also be tricked. Something I learned a long time ago.
You could switch out the top most Cloner_0 null for a sphere, delete the other nulls, rewind and play
Which would give you a replica of your original setup for export.

I could always jump back into R18 where this functionality is still available,
however my experiments are heavily affected by the glorious R20 fields and wouldn’t work in an older verion.

Hoping for a solution, maybe a practical extension of the new script or a revival of the old.

Thanks


#2

One really dull workaround I found, while experimenting.
Simply baking the Mograph objects (in this case they’re dynamic). Kill effectors, save and open in R18.
Running the old working Clone_Info_Hierarchy - Export as FBX - Reopen in C4D R20 and export as gLTF.

I run simple gLTF tests here: https://gltf-viewer.donmccurdy.com/
And if that’s successful, I run it on the tablet through Adobe Aero.

Another question for genius minds.
Let’s say I run a formula field with a color gradient applied.
Is there any way to bake a fixed color to an object? So that the color might be preserved.


#3

There is the GLTF exporter that should handle everything
https://labs.maxon.net/?p=3360

However if you are interesting in writing a tool for this particular baking, take a look at basedocument_read_animated_mesh_r16.py example to read data from an animated object.
Then you can create animation with this example ctrack_create_keys_r13.py.

Hope it helps, cheers.


#4

Thanks, sadly I know next to nothing about coding.


#5

I’ve been bringing my models into Unity and using their export to Sketchfab plugin. It retains the tsr animation but I’ve had limited success animating the texture maps . Have you had success with gltf export from R20?


#6

The gLTF exporter is pretty good. It has a bit of a wonky workaround to get PBR materials to work and so far I can’t get results that are 100% identical to the original asset export.

Let’s say I take an exported Substance asset - That will work perfectly in an AR app; as intended.
If I want to add animation in C4D, I have to follow the recommended material setup from the gLTF page.

Now when I export, something ia getting lost in translation. Especially pertaining to the roughness channels.

C4D’s process for making metal is weird and counter intuitive. I specify a roughness map, but the roughness slider still provides a level of control, similar to mix. If I max that out and export, the roughness map in AR is broken. So I need to figure that out.

As far as exporting animation goes, it does its job in a similar way to fbx.
Except of course, I’m having to go a really round about way to export the Cloner results I’m seeing.