This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## **** | |
# Merge cbz archives v1.3 | |
# Group 'cbz' archive content into bigger cbz archive chunks (made to group chapters on e-reader) | |
# put in the same location of cbz and run | |
# below set: archive name, chucks size, folder containing cbz to groups (default same as script) | |
## **** | |
import re | |
import zipfile | |
from pathlib import Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-# Find Approx closest color name from rgb/hex value - Standalone | |
#-# Just import/use get_color_name (check after line 1000) | |
def srgb_to_linearrgb(c): | |
if c < 0: return 0 | |
elif c < 0.04045: return c/12.92 | |
else: return ((c+0.055)/1.055)**2.4 | |
def hex_to_rgb(h): | |
'''Convert a hexadecimal color value to a 3-tuple of integers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
def animate_visibility(ob, switch=-1): | |
''' | |
add 2 keys to keyframe visibility: | |
switch options: | |
nohting or -1 = auto (set the inverse of actual state) | |
0 = visible before | |
1 = visible after | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, random | |
def quote(text): | |
return ('"' + text + '"') | |
texSize = 1024 | |
fontloc = "FONTS/" | |
out = "out/" | |
typosize = "80" | |
doc = "Source_text_lines.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from os.path import join, split | |
C = bpy.context | |
C.scene.render.filepath = join(split(C.scene.render.filepath)[0] + C.scene.camera.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from bpy import context as C | |
from bpy import data as D | |
from mathutils import Vector | |
from math import sqrt | |
def VectorLength(size, A, B): | |
''' | |
Calculate the vector lenght | |
return the coefficient to multiply this vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import os | |
C = bpy.context | |
scn = C.scene | |
dest_folder = os.path.dirname(scn.render.filepath) | |
if not os.path.exists(dest_folder): | |
print ("ERROR, destination folder must exist:\n", dest_folder, "not found") | |
else: | |
count = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import os | |
corrected = [] | |
print ("--------") | |
loc = bpy.path.abspath('//') | |
for i in bpy.data.images: | |
for root, folders, files in os.walk(loc): | |
for f in files: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def regplace(text, add, c=None): | |
''' | |
Get a path and return it with string appended : | |
Take a path containing a version number as first argument (parsed with the regex compiled passed as optional third arg) | |
Return it with string (given as second argument) suffixed to version | |
''' | |
if not c: | |
c = re.compile('([\.,_])([v,V]\d{2,3})([\.,_]?)') | |
head, tail = os.path.split (text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, time | |
start_time = time.time() | |
#good tuning for compromise quality/weight | |
tuning = '-c:v libx264 -x264opts keyint=60 -pix_fmt yuv420p -preset medium -crf 19 -c:a copy -y' | |
ext = 'srt' | |
cwd = os.getcwd() |
NewerOlder