Skip to content

Commit 23455d6

Browse files
committed
init
1 parent 26d42f0 commit 23455d6

File tree

9 files changed

+151
-2
lines changed

9 files changed

+151
-2
lines changed

.github/funding.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github: [moixllik]
2+
patreon: moixllik
3+
ko_fi: moixllik

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- 'addon/*.py'
12+
- 'addon/blender_manifest.toml'
13+
- 'addon/version.txt'
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Build Zip file
23+
run: cd addon/ && make build
24+
25+
- name: Create or update release
26+
id: create_release
27+
uses: softprops/action-gh-release@v2
28+
with:
29+
tag_name: latest
30+
release_name: "Latest Release"
31+
draft: false
32+
prerelease: false
33+
files: ./addon/*.zip
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Whitespace-only changes.

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
# btt-ai
2-
BTT to AI
1+
# BTT to AI
2+
3+
[Blender Video Text Tracks](https://github.com/moixllik/btt) to:
4+
5+
* [ ] Speech
6+
* [ ] Image
7+

addon/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
VER=$(shell cat ./version.txt)
2+
3+
build: update
4+
zip btt-$(VER).zip ./__init__.py ./blender_manifest.toml
5+
6+
update:
7+
sed -i 's/version = "0.0.0"/version = "$(VER)"/g' ./blender_manifest.toml
8+

addon/__init__.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import bpy
2+
import requests
3+
4+
5+
def btt_get_world():
6+
return bpy.context.scene.world
7+
8+
9+
def btt_get_strip_active():
10+
scene = bpy.context.scene
11+
strip = scene.sequence_editor.active_strip
12+
if strip.type == "TEXT":
13+
return strip
14+
15+
16+
class BTT_to_speech(bpy.types.Operator):
17+
bl_label = "To Speech"
18+
bl_idname = "btt.to_speech"
19+
bl_options = {"REGISTER", "UNDO"}
20+
21+
def execute(self, context):
22+
world = btt_get_world()
23+
strip = btt_get_strip_active()
24+
return {"FINISHED"}
25+
26+
27+
class BTT_to_image:
28+
bl_label = "To Image"
29+
bl_idname = "btt.to_image"
30+
bl_options = {"REGISTER", "UNDO"}
31+
32+
def execute(self, context):
33+
world = btt_get_world()
34+
strip = btt_get_strip_active()
35+
return {"FINISHED"}
36+
37+
38+
class BTT_menu(bpy.types.Menu):
39+
bl_label = "AI"
40+
bl_idname = "btt"
41+
42+
def draw(self, context):
43+
layout = self.layout
44+
layout.operator("btt.to_speech", text="To Speech")
45+
layout.operator("btt.to_image", text="To Image")
46+
47+
48+
def menu_func(self, context):
49+
self.layout.menu(BTT_menu.bl_idname)
50+
51+
52+
def register():
53+
bpy.utils.register_class(BTT_to_speech)
54+
bpy.utils.register_class(BTT_to_image)
55+
bpy.type.SEQUENCER_MT_editor_menus.append(menu_func)
56+
57+
58+
def unregister():
59+
bpy.utils.unregister_class(BTT_to_speech)
60+
bpy.utils.unregister_class(BTT_to_image)
61+
bpy.type.SEQUENCER_MT_editor_menus.remove(menu_func)
62+
63+
64+
if __name__ == "__name__":
65+
register()

addon/blender_manifest.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
schema_version = "1.0.0"
2+
3+
id = "btt-ai"
4+
version = "0.0.0"
5+
name = "BTT to AI"
6+
tagline = "AI generation with Strip Text"
7+
maintainer = "Irving Montalvo <@Moixllik>"
8+
website = "https://moixllik.github.io/btt-ai/"
9+
type = "add-on"
10+
tags = ["Sequencer"]
11+
blender_version_min = "4.2.0"
12+
license = ["SPDX:GPL-3.0-or-later"]
13+
14+
[permissions]
15+
network = "Send text and receive media files"
16+
files = "Write media files to local"
17+
18+
[build]
19+
paths_exclude_pattern = ["__pycache__/", "/.git/", "/*.zip"]

addon/version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

docs/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>BTT AI</title>
7+
</head>
8+
<body>
9+
<main>
10+
<h1><a href="">BTT AI</a></h1>
11+
</main>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)