Skip to content

Commit

Permalink
Support rhubarb 1.9 recognizers
Browse files Browse the repository at this point in the history
  • Loading branch information
scaredyfish committed Mar 6, 2019
1 parent 2ac6510 commit 0c92777
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
__version__ = '1.0.2'
__version__ = '1.0.5'

bl_info = {
'name': 'Rhubarb Lipsync',
'author': 'Andrew Charlton',
'version': (1, 0, 4),
'version': (1, 0, 5),
'blender': (2, 79, 0),
'location': 'Properties > Armature',
'description': 'Integrate Rhubarb Lipsync into Blender',
Expand Down
6 changes: 2 additions & 4 deletions op_blender_rhubarb.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,14 @@ def invoke(self, context, event):

inputfile = bpy.path.abspath(context.object.pose_library.mouth_shapes.sound_file)
dialogfile = bpy.path.abspath(context.object.pose_library.mouth_shapes.dialog_file)
recognizer = bpy.path.abspath(addon_prefs.recognizer)
executable = bpy.path.abspath(addon_prefs.executable_path)

command = [executable, "-f", "json", "--machineReadable", "--extendedShapes", "GHX", inputfile]
command = [executable, "-f", "json", "--machineReadable", "--extendedShapes", "GHX", "-r", recognizer, inputfile]

if dialogfile:
command.append("--dialogFile")
command.append(dialogfile )
else:
dialog = ""


self.rhubarb = subprocess.Popen(command,
stdout=subprocess.PIPE, universal_newlines=True)
Expand Down
11 changes: 11 additions & 0 deletions prefs_blender_rhubarb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import bpy
from bpy.types import AddonPreferences
from bpy.props import StringProperty
from bpy.props import EnumProperty

class RhubarbAddonPreferences(AddonPreferences):
bl_idname = __package__
Expand All @@ -9,10 +10,20 @@ class RhubarbAddonPreferences(AddonPreferences):
name="Rhubarb lipsync executable",
subtype='FILE_PATH',
)

recognizer = EnumProperty(
name = "Recognizer",
items = [
("pocketSphinx", "pocketSphinx", "PocketSphinx is an open-source speech recognition library that generally gives good results for English."),
("phonetic", "phonetic", "This recognizer is language-independent. Use it if your recordings are not in English.")
],
default = "pocketSphinx"
)

def draw(self, context):
layout = self.layout
layout.prop(self, "executable_path")
layout.prop(self, "recognizer")

def register():
bpy.utils.register_class(RhubarbAddonPreferences)
Expand Down

0 comments on commit 0c92777

Please sign in to comment.