Adding to Cart…
Licensing Agreement | Terms of Service | Privacy Policy | EULA
© 2024 Daz Productions Inc. All Rights Reserved.You currently have no notifications.
Licensing Agreement | Terms of Service | Privacy Policy | EULA
© 2024 Daz Productions Inc. All Rights Reserved.
Comments
@surody If I understand correctly you get three handlers that means somewhat you run the script three times in that blender instance. Try unchecking the register flag, then close and reopen blender, then load the scene. You should get zero handlers. Then check the register flag and close and reopen the scene, you should get one handler.
There are also a number of other addons in your setup with frame handlers. May be some other addon is somewhat interferring with diffeomorphic. Try with a clean setup of blender without any other addon but diffeomorphic. This way you should only have one diffeomorphic handler "onFrameChange", then run the animation and see if it works.
@Thomas, I see that if we load multiple scenes with the registered "morph_armature" script, then the script get registered multiple times. I mean load a scene then load another without closing blender. If I understand correctly this is not good since the script is the same and should register only once. Can't you check if the script is already registered and skip the registration in that case ? Just guessing here I am not a blender coder at all.
The registration code now removes old copies of the handler function. I also changed its name to "onFrameChangeDaz", to reduce the risk for a name collision with other add-ons. To avoid that the old "onFrameChange" handler hangs around, unregister the script, save the blend file, and restart Blender.
I did a clean install with Blender 2.93 and diffeo addon. Picture number 1 on the left is the console in a new scene after clean install without any addons. Picture 2 is after registering the script, picture 3 after rendering 10 frames and it looks like this on frame 10. Last but not least picture 4 on the right showing that it at least works in the viewport. With the changes you just added it seems like the rig adjustment only "works"(in the viewport) with registering the script, not with the "Morph Armature" button for single frames anymore.
I can confirn surodys issue with the script, while rendering an animation.
Here's a small video with my test result:
https://www.file-upload.net/download-14740104/0001-0010.mkv.html
I noticed something else now too. With ERCs activated in the global settings, every single custom morph I import makes the viewport permanently drop extreme amount of frames (feels like 100fps->10fps). It doesn't matter if just 1 or 50 custom morphs, the performance is way worse making me belief that there's something operating in the background even without having the script activated/registered. This needs a fix or some kind of button turning ERCs completely off in the background too (but keep the data if possible). Something like the "disable driver" button.
@gerster: That is the expected behaviour if either 1) the script has not been registered, or 2) the armature is deselected. It's not possible to say from your video whether any of those conditions hold.
@surody: The performance drop doesn't depend that much on the number of morphs. On each frame change, the script goes into edit mode, adjusts all bones, and goes back into object or pose mode. The costly operations are going in and out of edit mode, because that updates all objects in the scene, whether they have anything to do with the armatures or not. The slow framerate means that the handler has not been properly unregistered but is still running in the background. I have noticed that just disabling the register checkbox does not actually remove the handler. To be really safe I usually save the file and restart Blender.
Anyway, in the last commit we can toggle the ERC morphs on and off with the new Auto Morph Armature property in Morphs panel. So you should no longer have to mess with loading a file into the text editor, unless you want to run an ERC animation with the plugin disabled.
I'll test the new version but: The scene with the performance issues, I NEVER loaded in the script or registered it, I only started to set up a completely new scene, imported a character and import 1 single custom morph and as soon as I did that and try to move some bones in pose mode, the performance is just terrible. I tried the same scene by having ERC in global settings deactivated and the performance was normal. In my case and in gerster's case, we both registered the script and made sure to have the rig selected when we start rendering. I was asking him to try the script to reduce the possibility of a individual error. Would it be possible for you to record a quick process of how to get it to work with a video? That'd be really appreciated.
The performance issue with ERC in global settings activated after importing a custom morph seem to be fixed, I think. I'd have to test it further but with one official custom morph it works at least now and keeps the original performance.
I've to report that the armature morphing still doesn't work though, here's a video:
https://www.dropbox.com/s/qb1ev90xoyxls8u/Morph_Test.mp4?dl=0
After all this testing I still can't believe that it works in it's current state. It's important to test it with a finger altering morph/pose preset while also using a morph which changes the height of the character and do a test render (NOT just testing in the viewport). Also if possible make sure that you are at Frame 1 when you start rendering. When you start rendering the animation at Frame 10, the renderer starts the scene with the rig in position at Frame 10 and when you morph from Frame 1 to Frame 10 you won't notice much deforming. As you can see in the viewport it works for me too but it fails to work when I start rendering the scene.
Well, I have never recorded a video capture before, but I guess it could be done. But I would have to learn how to do it first.
If the update script runs when you start a new Blender session, perhaps it has been stored in your startup file. The new toggle property removes all copies of the handler. but only those with the new name.
The Amature was selected and the script was active.
It works fine, as long I just do a playback in the viewport. It's just broken If I do an animation via Render -> Render Animation.
Take a look on Surodys video, it's exaclty the same behavior for me: https://www.dropbox.com/s/qb1ev90xoyxls8u/Morph_Test.mp4?dl=0
The easiest way to record a video is to use the free software called "OBS". You can just immediatly press record on the right and on the top left "File" -> "Show Recordings" (I think it's phrased like that, I'm using a german OBS version) you'll find your recordings when you stopped recording.
https://obsproject.com/
OK, now I finally understand what you are saying. Yes, I see the same problem when rendering, and found the following note in the documentation.
Note on Altering Data
Altering data from handlers should be done carefully. While rendering the frame_change_pre and frame_change_post handlers are called from one thread and the viewport updates from a different thread. If the handler changes data that is accessed by the viewport, this can cause a crash of Blender. In such cases, lock the interface (Render → Lock Interface or bpy.types.RenderSettings.use_lock_interface) before starting a render.
However, enabling Render > Lock interface throws an error, because apparently it is no longer possible to go into edit mode. No idea what to do about this atm.
Like half a hour ago I got the idea that this could be the cause. I checked my blend file with the scene and "lock interface" was deactivated though. It still didn't work.
IMHO the best solution would be anyways a Blender pull request, which allows changing the Amature like shapekeys when ever you want and bake Amature changes into shapekeys, like in DAZ studio.
Yes, I know, not easy, but in my optionen the best solution which would also help oder human addons for Blender.
A work around for now would be batch rendering single images. There's addons for that but maybe you can implement it into the addon? Basically a script where you enter a frame range and you render single images in a batch with 1 frame increments. Since the morph armature technically works but just for current frames this would be a alternative for now.
New button at the top of the Utilities panel now renders the active frames, taking morphing armature into account. I also added a button for OpenGL rendering, because it didn't cost anything and it is something that I was missing.
It's fixed and works now, HALLELUJAH! Thank you!
I tweaked the behaviour a little and wrote a blog post: Morphing Armatures and Rendering
@surody @gerster @Thomas
Thank you for fixing this. I couldn't reproduce the issue myself because I was rendering single frames instead of an animation. I see blender can't switch in and out of edit mode while animating, that makes sense enough since edit mode is not intended for animation, but that's the flaw here.
p.s. I was busy with this https://developer.blender.org/T83022
The newest version seems to have lost it's auto morph armature button but I think you mentioned something in the blog post. I can't see any adjustment option for the viewport at the moment but it's really needed for IK baking for animations.
Scenario: The character has it's hands against a wall or ground and when the character shrinks or grows in size, with IK the arms are automatically bending outwards (growth) or inwards (shrink) to fit the pose to the new size and that needs to get baked, for that a viewport auto morph armature option is necessary.
Here's a video showcasing how it looks like with auto morph armature and a baked IK animation.
I only baked the first 50 frames, you can see at the end when it goes beyond 50 frames what happens when I can't utilize auto morph armature and IK together:
https://www.dropbox.com/s/1v4zrxevldxfdrg/auto_morph_armature_baking.mp4?dl=0
In short: Auto Morph Armature is needed
OK, auto armature morphing is back. However, I'm worried that people will be upset if an animation looks good in the viewport but the rendered images do not. Especially if the file has been sent to a render farm.
A solution for that would be hiding it a bit more or give out a warning when you activate it.
I'm a little lost here. How is this supposed to be used in a render farm ? I mean I understand it can't be used because edit mode is not allowed within animation rendering. So is there a way to use it in a render farm ? May be baking the animation first ? But will baking work to morph the rest pose ?
As of now I personally don't use render farms. I don't really know how it's supposed to work with renderfarms since you've to press a special button in the addon but the baking process just bakes the IK movement of the bones, not the bones adjustment of the morph armature.
Yep I guess it's not intended for render farms. Waiting an official reply from @Thomas so this is settled.
I'm currently trying to animate with wiggle bones and a animation layer addon. When I completely manually set up the pose it all seems to work but when I start off by importing a pose with diffeo at frame 1, then animate layer 1 and create a second layer with the addon, for some reason the wiggle bones stop working completely? Is there something I'm missing with importing poses? I definitely nailed down the issue to pose import but I don't understand why? What exactly does the pose import do besides bringing a specified bone rotation and location into Blender? There's also another issue with pose import. When I import a pose at frame 1 and keyframe all bones, then go to frame 10 for example and try to import a second pose to transition into, the second pose will reset/overwrite the first pose at frame 1. Is that intentionally or do I miss some setting?
Edit: I did further testing and it doesn't necessarily seem to be connected to the pose import. I'm not sure what's causing the issue right now.
Sounds like the New Action option is enabled (it is by default, I think). Then a new action is created and the pose at frame 1 doesn't belong to it.
Depending on the import options, the tool also clears and sets morphs, which are poses and shapekeys driven by armature properties. Perhaps the wiggle bones are also driven, and clearing morphs incidentally clears those drivers as well. Try to disable Clear Morphs.
Turning off "Affect Morphs" which turns off "clear morphs" too seems to at least fix the issue that poses always reset. The wiggle bone issue seems to be the wiggle bone addon itself I think. Because sometimes when I press ctrl+N multiple times to make a whole new scene and try to reproduce it, no matter what I do the wiggle bones won't work. Only after completely restarting Blender they work again.