Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
moixllik committed Sep 30, 2024
1 parent 26d42f0 commit 23455d6
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github: [moixllik]
patreon: moixllik
ko_fi: moixllik
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

permissions:
contents: write

on:
push:
branches:
- main
paths:
- 'addon/*.py'
- 'addon/blender_manifest.toml'
- 'addon/version.txt'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build Zip file
run: cd addon/ && make build

- name: Create or update release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: latest
release_name: "Latest Release"
draft: false
prerelease: false
files: ./addon/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Empty file added .gitignore
Empty file.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# btt-ai
BTT to AI
# BTT to AI

[Blender Video Text Tracks](https://github.com/moixllik/btt) to:

* [ ] Speech
* [ ] Image

8 changes: 8 additions & 0 deletions addon/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VER=$(shell cat ./version.txt)

build: update
zip btt-$(VER).zip ./__init__.py ./blender_manifest.toml

update:
sed -i 's/version = "0.0.0"/version = "$(VER)"/g' ./blender_manifest.toml

65 changes: 65 additions & 0 deletions addon/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import bpy
import requests


def btt_get_world():
return bpy.context.scene.world


def btt_get_strip_active():
scene = bpy.context.scene
strip = scene.sequence_editor.active_strip
if strip.type == "TEXT":
return strip


class BTT_to_speech(bpy.types.Operator):
bl_label = "To Speech"
bl_idname = "btt.to_speech"
bl_options = {"REGISTER", "UNDO"}

def execute(self, context):
world = btt_get_world()
strip = btt_get_strip_active()
return {"FINISHED"}


class BTT_to_image:
bl_label = "To Image"
bl_idname = "btt.to_image"
bl_options = {"REGISTER", "UNDO"}

def execute(self, context):
world = btt_get_world()
strip = btt_get_strip_active()
return {"FINISHED"}


class BTT_menu(bpy.types.Menu):
bl_label = "AI"
bl_idname = "btt"

def draw(self, context):
layout = self.layout
layout.operator("btt.to_speech", text="To Speech")
layout.operator("btt.to_image", text="To Image")


def menu_func(self, context):
self.layout.menu(BTT_menu.bl_idname)


def register():
bpy.utils.register_class(BTT_to_speech)
bpy.utils.register_class(BTT_to_image)
bpy.type.SEQUENCER_MT_editor_menus.append(menu_func)


def unregister():
bpy.utils.unregister_class(BTT_to_speech)
bpy.utils.unregister_class(BTT_to_image)
bpy.type.SEQUENCER_MT_editor_menus.remove(menu_func)


if __name__ == "__name__":
register()
19 changes: 19 additions & 0 deletions addon/blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
schema_version = "1.0.0"

id = "btt-ai"
version = "0.0.0"
name = "BTT to AI"
tagline = "AI generation with Strip Text"
maintainer = "Irving Montalvo <@Moixllik>"
website = "https://moixllik.github.io/btt-ai/"
type = "add-on"
tags = ["Sequencer"]
blender_version_min = "4.2.0"
license = ["SPDX:GPL-3.0-or-later"]

[permissions]
network = "Send text and receive media files"
files = "Write media files to local"

[build]
paths_exclude_pattern = ["__pycache__/", "/.git/", "/*.zip"]
1 change: 1 addition & 0 deletions addon/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
13 changes: 13 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BTT AI</title>
</head>
<body>
<main>
<h1><a href="">BTT AI</a></h1>
</main>
</body>
</html>

0 comments on commit 23455d6

Please sign in to comment.