Giter VIP home page Giter VIP logo

Comments (4)

scaredyfish avatar scaredyfish commented on May 21, 2024 1

Off the top of my head I'm not sure. RUNNING_MODAL is the expected behaviour - this prevents Blender locking up while the process runs. Eventually it will return FINISHED, but I'm not sure how to access that from your script. Waiting for the exe to end seems like a reasonable approach, but the addon is still processing the data returned from Rhubarb after it exits, so maybe your sleep needs to be longer.

Or maybe you'd be better off just copying some of the code from the addon directly into your script so you can run it non-modally. The relevant parts are all in op_blender_rhubarb.py.

from blender-rhubarb-lipsync.

scaredyfish avatar scaredyfish commented on May 21, 2024

I think you should be able to do this by using a simple wrapper python script. Something like:

import bpy; 

bpy.context.context.object.pose_library.mouth_shapes.sound_file = "<your sound file>"
bpy.ops.object.rhubarb_lipsync()

Check here for info on to how to pass arguments to a python script from the command line.

Hope this gets you started in the right direction at least.

from blender-rhubarb-lipsync.

FractalArt avatar FractalArt commented on May 21, 2024

I have a problem with a similar approach.

I want to do everything from a script, adding the pose library and populating it with the basic mouth shapes. After that, I load the audio and script files and perform the lip syncing in rhubarb. All of this I do in a python script that I call using

> blender --python myscript -- audio.wav script.txt output

When the blender GUI opens, I see that all works fine and the character is animated. Also the handles for the face rig bones appear in the timeline. When I save this using the GUI (File -> SaveAs) everything works as expected and when I open the blend file, the handles are still present.

However, when I add the commands to store the blend file into the python script and run it without the GUI (using -b), then the blend file is stored and the pose library is constructed and contains the basic mouth shapes, correctly associated to the rhubarb names but the handles for the face rig bones do not appear, i.e. the animation of the mouth is not present.

Do you have any idea what could go wrong? One thing I noticed was that I had to manually look for the process rhubarb.exe to finish as the call of bpy.ops.object.rhubarb_lipsync() does return immediately RUNNING_MODAL even though rhubarb does not seem to be done in the background. (When I don't look for the process to end manually and for example change mode from "POSE" to "OBJECT", I get errors.) Now I am wondering whether a similar thing might be happening with the handles and that maybe they are added in a background process but are not yet present when I store the blend file. I tried adding time.sleep()'s but so far without success.

from blender-rhubarb-lipsync.

FractalArt avatar FractalArt commented on May 21, 2024

Thanks a lot for your reply. I'll try it out!

from blender-rhubarb-lipsync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.