Hitchens: A DAZ Studio to Blender Live Link
I was soooo close to finishing this last night that I even took the day off from work to today finish it :)
In the release notes for Sagan v3, I talked a little about a new plugin, LotP and I'd like to describe one of the things it can do: Transfer a G8 armature to Blender for animating, and send the baked animation back to DS. No BVH, or FBX, no foot sliding or other slight errors. You just press a button and it transfers the animation to DS (Well, you just run a script until I make it an addon).
Actually, I am getting a little ahead of myself because 1) There's a typo in one of my data files that causes the shin or feet to not rotate properly, and what I just succeeded in doing is transfering a single frame, with the assumption that I could now do it for any arbitrary number of frames.
The images I've included was the result of:
- Using LotP to transfer the character armature from DS to Blender and creating a proxy rig how DS expects things.
- Fixing a few bone orientations in the Pelvis, Thighs, Feet, and Toes in the source animation.
- Running a script to retarget the animation ("retarget" is a bit overwrought because it just copies bone rotations)
- Baking the resultant animation ( I plan to make a preset for Auto Rig Pro, and it should work with Animation Layers).
- Running another script to send the pose back to DS.
That's it. Now there's just a little bit of polishing to be done. But notice that the results in DS and Blender are pretty much exact, less JCMs that were not applied in Blender. And by the way, another capability that I'm going to add to LotP is to apply the JCM's morph at desired frames by getting the morph from DS as it currently is, not having to worry about parsing finding/parsing morph files or slowing down the armature when it doesn't even matter.
So, I need to find and fix the feet/shin typo, and then export all frames over the entire animation range. Shouldn't take very long, knock on wood.
Whelp, I can't upload images, so there's that.
Edit: DS.jpg Blender.jpg
Comments
Ooohhhh, I'm excited! I'm looking forward to seeing this and action and giving it a whirl :) Thanks for working on this!
That's pretty sweet. DAZ should put you on their payroll...
I would be happy with just a little bit of technical support as opposed to just being discourteously ignored. I don't know what I did to these people.
You bet! I complain about Win32 a lot, but I daresay it's been fun.
youre a genius.
I've never animated or posed in Blender, but I hear it's a lot easier than Daz.
I guess that's the use-case here? That we can use Blender as animator/poser.
Questions:
Hi @lilweep
No, I'm not a genius, I just want this badly enough :)
My use case is a bit different from, say, Diffeo. I've always marveled at Thomas's ability (and patience) to figure out all of DS's foibles. My approach is to leave all of the details to DS itself, and just grab the baked geometry. It is intended to get just enough into Blender so that one can animate with IK and layers, and be able to have characters interact with each other, precisely. That means the mesh is at base res for speed, and the JCMs are only needed at certain frames, say, one character is touching another. Then, get the animation back to DS, precisely as it was in Blender. Once the animation is back in DS, I can export it through the usual ways, i.e. Diffeo or Sagan, or the upcoming LotP at render time.
To answer your specific questions:
It won't be getting JCMs at all. At any given time, and only on the frames where it is actually needed because a character is touching another character's knee while it's bent or something similar, it'll request the actual geometry as it is in DS, with the JCMs already baked in, and display that. I don't think JCMs are needed blanket across entire animations. To keep the viewport as fast as possible while tweaking the animation, it does everything at base res. But once everything is back in DS, how you choose to export is up to you. Sagan, for example, can output at whatever level. This is more of a tool to allow DS users to use the superior animation tools in Blender, not necessarily to be an export option. And besides, LotP will be like Sagan on steroids, doing away with Alembic or whatever other export method, and during rendering frames, it'll feel like the scene is transferred instantaneously. That's a slightly greater programming challenge in an area which I have zero experience (hacking Blender Geometry Nodes in C++), but I do have a do-nothing geometry node already working that doesn't crash anything, so so-far-so-good.
Base res. Again, I don't mean to replace the existing export options, just enable DS users to animate in Blender and accurately reproduce the animation in DS in the simplest way possible. But once the animation is re-applied in DS, it can be exported at any res with something like Sagan, or in the future, with LotP which will make the export essentially free, time-wise, because it overlaps getting the next frame(s) with rendering the current one (and caches previous ones as well, if you're using motion blur).
The script to send the animation back to DS is almost done, but the LotP functionality that will actually export geometry at render time will take a while longer.
Of course you may also open a bug report at difffeomorphic and contribute an enhancement for Thomas to implement, if you find a better way to do things.
https://bitbucket.org/Diffeomorphic/import_daz/issues
@Padone
Doesn't Diffeo already export animation back to Blender, just as a .duf file?
So far, this is working out easier than I expected. I guess that's what happens when there's example code, documentation, and a strong community.
The Geometry Node So Far
this sounds cool
I would need to learn how to animate in Blender though
Wendy, it makes me smile thinking about what you would do with ARP and Animation Layers, if you haven't already :)
too much of a Carrara and iClone user but it would have to be easier than animating in DAZ studio
my issue with Blender is I spend more time Googling how to do stuff than in the program and promptly forget everything I just learnt
I do use it daily for certain things mostly the video editor and have done some basic editing of FBX animations in it
Modelling I find it hard
Yes. I meant if you find any bug or have a proposal for improvements.
@WendyLuvsCatz
With ARP you have the best general purpose retargeter, outside of the mighty Autodesk Motionbuilder.
You can grab any character mesh from Sketchfab or “ready player me” (and of course any Daz or poser figure) and in minutes have a professional Human IK control rig with a built in retargeter that is far better than the old Iclone 3DX and certainly cheaper than the $600 upgrade to IC8/CC4.
TheMysteryIsThePoint,
Try playing nice. New year, new opportunity to set aside the hectoring, the haranguing, the hassling, the hellraising, the hounding, the heckling, the hissing ... for some honest-to-goodness gee whiz appreciation. (Did I say 'hectoring?' You are like a wrathful Achilles calling out the Daz prince of Troy! Why not call them in instead, kumbaya style.) As the old song goes, you're never fully dressed without a smile! That plus a whole lotta luv may get you further in your awesome endeavors.
Cheers!
@csaa
That's proper wisdom you've given, that would behoove anyone to adopt in just about every sector of their inter-personal communications. But...
Observe my interactions here. I am by nature a kumbaya kind of guy, I value the connections I've made with other DAZ users here, and the most important thing to me is the sense of community, around a common endeavor. My small contribution to it is very satisfying personally for that reason, and it has never crossed my mind what I could probably have charged for Sagan when a broken-as-all-getout Alembic exporter is $90. My first DM to a DAZ dev was full of all the deferrence, wonder, and admiration that you would expect. But...
At some point, one must begin to wonder how poorly I must have been repeatedly treated in order to take personally something (technical support) that is not generally considered personal, no? I'm sort of a jerk now, but I started out exactly how you suggest I should be.
+1
Blender's already got a smoothing function for mocap data, so with ARP and Animation Layers, the only thing missing is something to simplify curves, i.e. remove all the key frames that don't contribute to curve. There's a really cool guy, a researcher named Richard Roberts who invented an algorithm to do just that, but his implementation is tied to Maya, which I don't have anymore, so it was difficult to even see how it worked. But there's another guy, Adam Baker, who said he might make an addon for Blender. If that happens, I'd say that Blender would be a first-rate animation package without any type of qualification. What MoBu can do that Blender can't, I can live without.
https://docs.blender.org/manual/en/latest/addons/add_curve/simplify_curves.html
Always look forward to easier to use tools. Good work.
@Padone Thank you for the belated Christmas present :) How could I possibly have missed this? My hope is that it's not just a merger or some other simple model, much like the way people (including me) copy bone rotation constraints and call that "retargetting"... Richard Roberts's implementation used Eigen Values to choose keyframes. I hope the Blender addon does something equally sophisticated. Will try it tonight.
Thanks again!
As I understand it that's a simple approximation by distance that works in most cases. May "smooth" too much.
@csaa, Did you happen to PM the (salaried) DAZ devs with the same fine advice? Over the years, it's pretty obvious who here is doing *nothing* but playing nice, and simply begging for professional level collaboration/response/documentation to help contribute brilliant and cost-free tools to this community.
just sayin'
--ms
Thank you for the support, MS.
@Padone
Yes, I tried it, and it's a pretty naive algorithm. It smooths way too much even before one begins to see a meaningful reduction in the number of keyframes. Thanks, though.
The financial market domain is rich with curve-fitting/smoothing tools that help investers 'see' trends buried in noisy trading graphs. I wonder if there are any OS/PD libraries that might be useful in simplifying and de-noising animation (and mocap) data... Sorry I don't know enough to recommend even the simplest of toolkits, but it might be a possible resource to draw from.
--ms
Through my job I've got access to NTRS and CORE. I'll do a search. I've also go access to Matlab, LabView, and SimuLink; maybe there's something in the libraries that come with them. But I think the path of least resistance would be to grok Richard Roberts's algorithm... it's just kind of hard to figure out when I can't see nything because I no longer have access to Maya. I think it'd be the final missing piece.
It'd be great if you could find something, especially if already done and tuned for this domain. I don't have access to Maya, but may know someone who also might be interested and have access/motivation. Will PM with details.
One of my favorite things about DAZ aniblocks is the layer edits where tweaks can be ... layered, leaving the base animation alone. One of the most disappointing 'features' of the aniblock infrastructure is when baking aniblocks to the DS timeline, *all* of the keys baked to the DAZ timeline are set, even if they are not set/changed in the original aniblock timeline... this makes it impractical to go back and forth between the two timelines. (and, not having linear interpolation available in aniblocks almost make it a non-starter, but that's a different thread I won't bother starting.) To my eye, aniblocks are a million $ idea with a thousand $ execution. It's what sucked me in to the DS environment when I was far more ignorant about it all. Battle scars a-plenty, heh.
A keyframe decimation/simplification tool like this would not only appeal to my OCD/minimalist tendencies, but would make general animation tweaking in DS far more practical (less painful?).
I'll happily help test any/all options you want to explore.
best,
--ms
(edits to clarify wording/concepts)
TheMysteryIsThePoint,
I wanted to apologize for any ruffled feathers my earlier comment caused. I still had a hangover from the new year's levity. My remarks were in no way a "hit job" on your talents or your generous contributions to the community. Again, I apologize for making light of the challenges you've experienced.
Which is not to say I'm unaware of the obstacles you've faced. Admittedly I'm not privy to your interactions with the devs, but it's certainly not the first time anyone has run up against that wall. (The Homeric allusion was deliberate! And, yes, at various point in the saga, everyone thought Achilles acted like a jerk.)
I came of age in the 90s when the Linux-Windows wars seemed interminable. "Linux is a cancer!" remember that? And yet here we are today ... you can go online to the MS Marketplace and download an installer for Ubuntu. Who would have known that yesterday's acrimony would give way to the Windows Subsystem for Linux. Convivial and symbiotic. Strange indeed.
What happened? I don't think the combatants had any epiphanies, kumbaya style; instead the environment changed, making for a sensible co-existence between the two OSes. It's all business, nothing personal: there are no allies or enemies, just opportunities. If the opportunity to profit doesn't exist, then collaboration isn't forthcoming.
At the risk of comparing apples to oranges, it may be wise on your part to advocate for a similar change in the environment. Which is to say, seeing how much your work is hitched to the Blender workhorse, give your best promoting it. To your credit you're doing this ... but it's the acrimonous behavior that IMHO is holding you back. First of all, all the hectoring won't get you far. More importantly, good vibes beget more advocates. That is, the Blender community doesn't thrive on combat and controversy. Kumbaya, that's the key to its growth. And when the day comes that the Blender ecosystem is too important to ignore, from a business POV, then you're likely to find the gates opening for you.
Of course, I don't advocate holding your breath. But there's enough rancour going around in the world today, adding to it is pointless. In the spirit of the new year, I just think it makes more sense for you to walk away from that battle.
Cheers!
@csaa
No offense taken, friend.
Yes, I was (and still am) a UNIX developer during the Great War you remember :) I think another great irony is IBM, which Linux saved from the brink of bankruptcy, and Red Hat, a billion dollar company that proved Steve Ballmer's Cancer analogy to be so backward. Just like Richard M. Stallman said: "When the source code is locked away in a Cathedral and very few people can observe it, learn it, fix it, and extend it, it is really no wonder that the quality is low, and support is expensive."
Again, you are not wrong in what you are saying :) I am simply convinced that my actions, Kumbaya or rancorous, have absolutely zero effect of decisionmaking at DAZ, either way. So there is no point in moderating my id. Believe me, if in 2018 I thought there were some act that I could perform that would result in even the most modest form of official technical assistance, I would have done it, without question or hesitation. And who am I kidding, I still would in 2023.
@csaa Not everything is about profit, diffeomorphic is developed just for fun, and it's the best around.