Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated for godot 4, and added support for AudioStream2d, 3d, and Spr… #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tool
@tool
extends RichTextLabel

func _ready() -> void:
connect( "meta_clicked", self, "_on_meta_clicked")
connect( "meta_clicked", _on_meta_clicked)

func _on_meta_clicked(meta :String):
OS.shell_open(meta)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tool
@tool
extends Popup

const GROUP_PLUGIN :String= "plugin rhubarb_lipsync_integration"
Expand All @@ -9,17 +9,17 @@ func _enter_tree() -> void:
visible = true

func _ready() -> void:
connect("hide", self, "_on_hide")
connect("hide", _on_hide)

if !is_inside_tree():
yield(self, "tree_entered")
await tree_entered


$"Panel/VBox/VersionLabel".text = "Version: " + get_plugin_version()
$"Panel/VBox/VersionLabel".text = "Version: " + await get_plugin_version()

func get_plugin_version() -> String:
if !is_instance_valid(self):
yield(get_tree(), "idle_frame")
#if !is_instance_valid(self):
#await get_tree().idle_frame
pluginInstance = _get_pluginInstance()

var pluginConfig :ConfigFile= ConfigFile.new()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
[gd_scene load_steps=13 format=2]

[ext_resource path="res://addons/rhubarb_lipsync_integration/assets/LipsyncImporterTheme.tres" type="Theme" id=1]
[ext_resource path="res://addons/rhubarb_lipsync_integration/LipsyncAboutPopup/LipsyncAboutPopup.gd" type="Script" id=2]
[ext_resource path="res://addons/rhubarb_lipsync_integration/interface/RectHandlerContainer.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/rhubarb_lipsync_integration/interface/Titlebar.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/rhubarb_lipsync_integration/assets/icons/icon_about.png" type="Texture" id=5]
[ext_resource path="res://addons/rhubarb_lipsync_integration/assets/JetBrainsMono-Bold.ttf" type="DynamicFontData" id=6]
[ext_resource path="res://addons/rhubarb_lipsync_integration/LipsyncAboutPopup/InfoRTLabel.gd" type="Script" id=7]
[ext_resource path="res://addons/rhubarb_lipsync_integration/assets/icons/icon_warning.png" type="Texture" id=8]
[ext_resource path="res://addons/rhubarb_lipsync_integration/assets/icons/plugin_icon/icon_plugin.png" type="Texture" id=9]
[ext_resource path="res://addons/rhubarb_lipsync_integration/LipsyncAboutPopup/ReportBugButton.gd" type="Script" id=10]

[sub_resource type="DynamicFont" id=1]
size = 28
font_data = ExtResource( 6 )

[sub_resource type="DynamicFont" id=2]
size = 12
font_data = ExtResource( 6 )
[gd_scene load_steps=13 format=3 uid="uid://cenvxyatdk4yd"]

[ext_resource type="Theme" uid="uid://bqc7yaggmcr18" path="res://addons/rhubarb_lipsync_integration/assets/LipsyncImporterTheme.tres" id="1"]
[ext_resource type="Script" path="res://addons/rhubarb_lipsync_integration/LipsyncAboutPopup/LipsyncAboutPopup.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://dkxi3tvsri3tv" path="res://addons/rhubarb_lipsync_integration/interface/RectHandlerContainer.tscn" id="3"]
[ext_resource type="PackedScene" path="res://addons/rhubarb_lipsync_integration/interface/Titlebar.tscn" id="4"]
[ext_resource type="Texture2D" uid="uid://d7kfe10d12jh" path="res://addons/rhubarb_lipsync_integration/assets/icons/icon_about.png" id="5"]
[ext_resource type="FontData" uid="uid://pf5n213k68kn" path="res://addons/rhubarb_lipsync_integration/assets/JetBrainsMono-Bold.ttf" id="6"]
[ext_resource type="Script" path="res://addons/rhubarb_lipsync_integration/LipsyncAboutPopup/InfoRTLabel.gd" id="7"]
[ext_resource type="Texture2D" uid="uid://cmvqf8155k21d" path="res://addons/rhubarb_lipsync_integration/assets/icons/icon_warning.png" id="8"]
[ext_resource type="Texture2D" uid="uid://lnwitcisxsnr" path="res://addons/rhubarb_lipsync_integration/assets/icons/plugin_icon/icon_plugin.png" id="9"]
[ext_resource type="Script" path="res://addons/rhubarb_lipsync_integration/LipsyncAboutPopup/ReportBugButton.gd" id="10"]

[sub_resource type="Font" id="1"]
data/0 = ExtResource( "6" )

[sub_resource type="Font" id="2"]
data/0 = ExtResource( "6" )

[node name="LipsyncAboutPopup" type="Popup"]
size = Vector2i(1000, 500)
visible = true
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 1 )
script = ExtResource( 2 )
unresizable = false
theme = ExtResource( "1" )
script = ExtResource( "2" )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Panel" type="Panel" parent="."]
margin_right = 607.0
margin_bottom = 528.0
rect_min_size = Vector2( 500, 220 )
rect_min_size = Vector2(1000, 500)
rect_clip_content = true
__meta__ = {
"_edit_use_anchors_": false
Expand All @@ -43,136 +37,118 @@ __meta__ = {
[node name="VBox" type="VBoxContainer" parent="Panel"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 20.0
margin_top = 10.0
margin_right = -20.0
margin_bottom = -10.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 15
theme_override_constants/separation = 15
__meta__ = {
"_edit_use_anchors_": false
}

[node name="TitleBar" parent="Panel/VBox" instance=ExtResource( 4 )]
margin_right = 567.0
margin_bottom = 40.0
[node name="TitleBar" parent="Panel/VBox" instance=ExtResource( "4" )]
offset_right = 1380.0
offset_bottom = 40.0
title_name = "About"
icon_texture = ExtResource( 5 )
icon_texture = ExtResource( "5" )
window_path = NodePath("../..")

[node name="HBoxContainer" type="HBoxContainer" parent="Panel/VBox"]
margin_top = 55.0
margin_right = 567.0
margin_bottom = 175.0
offset_top = 55.0
offset_right = 1380.0
offset_bottom = 855.0
size_flags_vertical = 0

[node name="NameLabel" type="Label" parent="Panel/VBox/HBoxContainer"]
margin_right = 375.0
margin_bottom = 111.0
offset_right = 576.0
offset_bottom = 23.0
size_flags_horizontal = 3
size_flags_vertical = 0
custom_fonts/font = SubResource( 1 )
theme_override_fonts/font = SubResource( "1" )
text = "Rhubarb Lip Sync Third Party Integration for Godot"
autowrap = true

[node name="PluginLogo" type="TextureRect" parent="Panel/VBox/HBoxContainer"]
margin_left = 379.0
margin_right = 567.0
margin_bottom = 120.0
rect_min_size = Vector2( 120, 120 )
offset_left = 580.0
offset_right = 1380.0
offset_bottom = 800.0
rect_min_size = Vector2(120, 120)
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.5
texture = ExtResource( 9 )
expand = true
texture = ExtResource( "9" )
stretch_mode = 5
__meta__ = {
"_edit_use_anchors_": false
}

[node name="VersionLabel" type="Label" parent="Panel/VBox"]
margin_top = 190.0
margin_right = 567.0
margin_bottom = 210.0
custom_colors/font_color = Color( 0.227451, 0.380392, 0.505882, 1 )
offset_top = 870.0
offset_right = 1380.0
offset_bottom = 893.0
theme_override_colors/font_color = Color(0.227451, 0.380392, 0.505882, 1)
text = "Version: 1.1"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="InfoRTLabel" type="RichTextLabel" parent="Panel/VBox"]
margin_top = 225.0
margin_right = 567.0
margin_bottom = 421.0
offset_top = 908.0
offset_right = 1380.0
offset_bottom = 908.0
focus_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 2.0
custom_colors/default_color = Color( 0.597818, 0.597818, 0.757631, 1 )
bbcode_enabled = true
bbcode_text = "[b][color=white][url=https://github.com/DanielSWolf/rhubarb-lip-sync]Rhubarb Lip Sync[/url][/color][/b] is an open-source command-line program made by [b][color=white][url=https://github.com/DanielSWolf]Daniel Wolf[/url][/color][/b] that allows you to quickly create 2D mouth animation from voice recordings. You can use it for animating speech in computer games, animated cartoons, or any similar project.

[b][color=white][url=https://github.com/AniMesuro/rhubarb-lipsync-tp-integration-godot]Rhubarb Lip Sync T.P. Integration for Godot[/url][/color][/b] is a Rhubarb Lip Sync Integration plugin for Godot Engine made by [b][color=white][url=https://github.com/AniMesuro]AniMesuro[/url][/color][/b]. You can use it by opening the user interface [color=grey][u][b]Project > Tools > Rhubarb Lipsync TPI[/b][/u][/color] or using the functions directly by calling the plugin instance. [color=grey](see github page)[/color]"
theme_override_colors/default_color = Color(0.597818, 0.597818, 0.757631, 1)
text = "Rhubarb Lip Sync is an open-source command-line program made by Daniel Wolf that allows you to quickly create 2D mouth animation from voice recordings. You can use it for animating speech in computer games, animated cartoons, or any similar project.

Rhubarb Lip Sync T.P. Integration for Godot is a Rhubarb Lip Sync Integration plugin for Godot Engine made by AniMesuro. You can use it by opening the user interface Project > Tools > Rhubarb Lipsync TPI or using the functions directly by calling the plugin instance. (see github page)"
bbcode_enabled = true
selection_enabled = true
script = ExtResource( 7 )
script = ExtResource( "7" )

[node name="ReportBugButton" type="Button" parent="Panel/VBox"]
margin_left = 193.0
margin_top = 436.0
margin_right = 373.0
margin_bottom = 460.0
rect_min_size = Vector2( 180, 24 )
offset_left = 600.0
offset_top = 923.0
offset_right = 780.0
offset_bottom = 947.0
rect_min_size = Vector2(180, 24)
size_flags_horizontal = 4
text = "Report a Bug"
icon = ExtResource( 8 )
icon = ExtResource( "8" )
expand_icon = true
script = ExtResource( 10 )
script = ExtResource( "10" )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Label" type="Label" parent="Panel/VBox"]
margin_top = 475.0
margin_right = 567.0
margin_bottom = 508.0
offset_top = 962.0
offset_right = 1380.0
offset_bottom = 985.0
size_flags_horizontal = 3
custom_fonts/font = SubResource( 2 )
custom_colors/font_color = Color( 0.254902, 0.258824, 0.27451, 1 )
theme_override_colors/font_color = Color(0.254902, 0.258824, 0.27451, 1)
theme_override_fonts/font = SubResource( "2" )
text = "Please make sure to report the bug to the right project as most bugs are probably related to the Integration rather than Rhubarb Lip Sync."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}

[node name="RectHandlers" parent="Panel" instance=ExtResource( 3 )]
[node name="RectHandlers" parent="Panel" instance=ExtResource( "3" )]
modulate = Color(1, 1, 1, 0)
_windowRect = NodePath("..")

[node name="HandlerTop" parent="Panel/RectHandlers" index="0"]
modulate = Color( 1, 1, 1, 1 )
margin_right = 607.0
handler_direction = 0
modulate = Color(1, 1, 1, 1)
_windowRect = NodePath("../..")

[node name="HandlerBottom" parent="Panel/RectHandlers" index="1"]
modulate = Color( 1, 1, 1, 1 )
margin_top = 518.0
margin_right = 607.0
margin_bottom = 528.0
modulate = Color(1, 1, 1, 1)
_windowRect = NodePath("../..")

[node name="HandlerLeft" parent="Panel/RectHandlers" index="2"]
modulate = Color( 1, 1, 1, 1 )
margin_bottom = 528.0
modulate = Color(1, 1, 1, 1)
_windowRect = NodePath("../..")

[node name="HandlerRight" parent="Panel/RectHandlers" index="3"]
modulate = Color( 1, 1, 1, 1 )
margin_left = 597.0
margin_right = 607.0
margin_bottom = 528.0
modulate = Color(1, 1, 1, 1)
_windowRect = NodePath("../..")

[editable path="Panel/RectHandlers"]
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
tool
@tool
extends Button

const LINK_ISSUES_GITHUB :String= "https://github.com/AniMesuro/rhubarb-lipsync-tp-integration-godot/issues"

func _ready() -> void:
connect("pressed", self, "_on_pressed")
connect("pressed", _on_pressed)


func _on_pressed():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
tool
@tool
extends TextureButton

export (PackedScene) var SCN_LipsyncAboutPopup
@export var SCN_LipsyncAboutPopup:PackedScene
var lipsyncAboutPopup :Popup

func _ready() -> void:
connect("pressed", self, "_on_pressed")
connect("pressed", _on_pressed)


func _on_hide():
Expand All @@ -14,7 +14,7 @@ func _on_hide():
queue_free()

func _on_pressed() -> void:
lipsyncAboutPopup = SCN_LipsyncAboutPopup.instance()
lipsyncAboutPopup = SCN_LipsyncAboutPopup.instantiate()
owner.add_child(lipsyncAboutPopup)
# lipsyncAboutPopup.connect("tree_exited", self, "_on_LipsyncAboutPopup_tree_exited")
lipsyncAboutPopup.popup()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
tool
@tool
extends HBoxContainer

const STR_ANIMATIONPLAYER_SELECTED :String = "Please select an Animation from AnimationPlayer"
const STR_ANIMATIONPLAYER_NOT_SELECTED :String = "Please select an AnimationPlayer above before selecting animation."

const TEX_IconExpand :StreamTexture= preload("res://addons/rhubarb_lipsync_integration/assets/icons/icon_expand.png")
const TEX_IconExpand :StreamTexture2D= preload("res://addons/rhubarb_lipsync_integration/assets/icons/icon_expand.png")
#const TEX_icon_not :StreamTexture= preload("res://addons/rhubarb_lipsync_importer/assets/icons/icon_not.png")
#const TEX_icon_yes :StreamTexture= preload("res://addons/rhubarb_lipsync_importer/assets/icons/icon_yes.png")


var last_index :int= -1

onready var warningIcon :TextureRect= $WarningIcon
onready var menuButton :MenuButton= $MenuButton
@onready var warningIcon :TextureRect= $WarningIcon
@onready var menuButton :MenuButton= $MenuButton
var popupMenu :PopupMenu

func _ready() -> void:
menuButton.text = STR_ANIMATIONPLAYER_NOT_SELECTED
popupMenu = menuButton.get_popup()
menuButton.connect( "pressed", self, "_on_MenuButton_pressed")
popupMenu.connect( "id_pressed", self, "_on_PopupMenu_item_selected")
owner.connect("updated_reference", self, "_on_owner_reference_updated")
menuButton.connect( "pressed", _on_MenuButton_pressed)
popupMenu.connect( "id_pressed", _on_PopupMenu_item_selected)
owner.connect("updated_reference", _on_owner_reference_updated)

if last_index == -1:
enable_warning("No AnimationPlayer node selected. Can't proceed")



func _on_MenuButton_pressed():
print()
var animPlayer :AnimationPlayer= owner.anim_animationPlayer
popupMenu.clear()
if !is_instance_valid(animPlayer):
print("anim player not valid")
return

for animation in animPlayer.get_animation_list():
for animation in animPlayer.get_animation_list():
popupMenu.add_item(animation)


Expand All @@ -42,7 +44,7 @@ func _on_PopupMenu_item_selected(id :int):
if id != -1:
disable_warning()
owner.anim_name = popupMenu.get_item_text(id)
menuButton.icon = owner.pluginInstance.get_editor_interface().get_inspector().get_icon("Animation", "EditorIcons")
#menuButton.icon = owner.pluginInstance.get_editor_interface().get_inspector().get_icon("Animation", "EditorIcons")
menuButton.text = owner.anim_name
owner.emit_signal("updated_reference", 'anim_name')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tool
@tool
extends HBoxContainer


Expand All @@ -22,7 +22,7 @@ func _enter_tree() -> void:

func validate_rhubarb_path() -> void:
if !is_inside_tree():
yield(self, "tree_entered")
await tree_entered
var Settings :Dictionary= owner.pluginInstance.Settings
if Settings == {}:
return
Expand Down
Loading