Skip to content

Commit

Permalink
feat(hiero): add track item actions
Browse files Browse the repository at this point in the history
- align track item
- remove version suffix
  • Loading branch information
NateScarlet committed Mar 17, 2022
1 parent 595ffc1 commit 11af7e9
Show file tree
Hide file tree
Showing 47 changed files with 92,971 additions and 263 deletions.
2 changes: 2 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dialog's",
"DONT",
"glcolor",
"hiero",
"HOOKIMPL",
"i'th",
"idiv",
Expand Down Expand Up @@ -59,6 +60,7 @@
"venv",
"vfield",
"vtransform",
"wulifang",
"xpos",
"xyrt",
"ypos",
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ endif
default: .venv build docs/_build/html $(VENV_SITEPATH)/lib.pth

build: docs/_build/html lib/site-packages/.sentinel
$(MAKE) -C wulifang_plugin

export PYTHONPATH
export PYTHONIOENCODING=UTF-8


# https://github.com/pypa/pip/issues/5735
lib/site-packages/.sentinel: export PIP_NO_BUILD_ISOLATION=false
lib/site-packages/.sentinel: requirements.txt patches/*.patch
Expand Down Expand Up @@ -53,3 +55,4 @@ $(VENV_SITEPATH)/lib.pth: lib/site-packages/.sentinel
test: .venv/.sentinel
. ./scripts/activate-venv.sh &&\
pytest

16 changes: 16 additions & 0 deletions Python/Startup/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding=UTF-8 -*-
# pyright: strict
""". """

from __future__ import (absolute_import, division, print_function,
unicode_literals)

if True:
import os
import sys
WORKSPACE_FOLDER = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
sys.path.insert(0, WORKSPACE_FOLDER)

import wulifang.hiero

wulifang.hiero.init()
13 changes: 13 additions & 0 deletions docs/features/hiero_align_track_item.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Hiero 轨道项对齐
============================

按已选轨道项的时间设置其他轨道上的同名项时间,
支持变速和剪切。

轨道项名称要求完全匹配,可用 :doc:`./hiero_remove_version_suffix` 移除名称中的版本。

选中项中有同名时报错。

选中项时间范围冲突时报错。

如果其他轨道上存在名称不匹配的轨道项和指定范围冲突,会被移至轨道尾部。
6 changes: 6 additions & 0 deletions docs/features/hiero_remove_version_suffix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Hiero 移除名称中的版本
=================================

批量将所选对象名称中的 ``_v{版本}`` 后缀移除。

当前仅支持对轨道项使用。
3 changes: 3 additions & 0 deletions install.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
cmd.exe /c "%~dp0\install_hiero.cmd" || PAUSE
cmd.exe /c "%~dp0\install_nuke.cmd" || PAUSE
14 changes: 14 additions & 0 deletions install_hiero.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@ECHO off
CHCP 65001
SET "DEST=%UserProfile%\.nuke\Python\Startup"
IF NOT EXIST %DEST% MKDIR %DEST%
SET "FILE=%DEST%\com-wulifang-sudito-hiero-plugin-startup.py"
SET "DIRNAME=%~dp0"
SET "DIRNAME=%DIRNAME:\=/%"
SET "TEXT=hiero.core.addPluginPath('%DIRNAME%')"

ECHO # -*- coding=UTF-8 -*- > %FILE%
ECHO import hiero.core >> %FILE%
ECHO.>>"%FILE%"
ECHO %TEXT%>>"%FILE%"
ECHO 已添加 hiero 启动脚本: %FILE%
33 changes: 33 additions & 0 deletions install_nuke.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@ECHO off
CHCP 65001
setlocal ENABLEDELAYEDEXPANSION
SET "DIRNAME=%~dp0"
SET "DIRNAME=%DIRNAME:\=/%"
SET "TEXT=nuke.pluginAddPath('%DIRNAME%')"
SET "FILE=%UserProfile%\.nuke\init.py"

IF NOT EXIST %FILE% (ECHO import nuke > %FILE%)

FIND /C /I "%TEXT%" "%FILE%" >nul 2>nul
IF %ERRORLEVEL% EQU 0 (GOTO Success)

ECHO.>>"%FILE%" && ECHO %TEXT%>>"%FILE%"

FIND /C /I "%TEXT%" "%FILE%" >nul 2>nul
IF %ERRORLEVEL% EQU 0 (GOTO Success) ELSE (GOTO Fail)

:Success
ECHO -----当前init.py内容------
TYPE "%FILE%"
ECHO -------------------------
ECHO 安装成功
ECHO 重启Nuke即可
ECHO.
GOTO :EOF

:Fail
ECHO 插件安装失败, 请确认能够手动编辑 %FILE% 后重试
ECHO.
EXIT 1
GOTO :EOF

20 changes: 6 additions & 14 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,19 @@
"executionEnvironments": [
{
"root": "lib",
"extraPaths": [
"lib/site-packages",
]
"extraPaths": ["lib/site-packages"]
},
{
"root": "tests",
"extraPaths": [
"lib/site-packages"
],
"extraPaths": ["lib/site-packages"]
},
{
"root": "wulifang"
}
],
"typeCheckingMode": "basic",
"reportMissingModuleSource": "none",
"reportUnusedImport": "error",
"reportUnusedCallResult": "error",
"reportUnknownMemberType": "information",
"include": [
"lib",
"*.py"
],
"exclude": [
"lib/site-packages",
],
"exclude": ["lib/site-packages", "**/vendor"]
}
3 changes: 2 additions & 1 deletion scripts/deploy_to_server.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ Invoke-NativeCommand git push -f server HEAD origin/gh-pages
Invoke-NativeCommand git -C $(git remote get-url server) checkout $(git rev-parse HEAD)
Invoke-NativeCommand git -C $(git remote get-url server) clean -fx *.pyc
Invoke-NativeCommand git -C "$(git remote get-url server)/docs/_build/html" checkout $(git rev-parse origin/gh-pages)
Invoke-NativeCommand robocopy lib\site-packages "$(git remote get-url server)\lib\site-packages" /MIR /R:0
& robocopy lib\site-packages "$(git remote get-url server)\lib\site-packages" /MIR /R:0
& robocopy wulifang\vendor "$(git remote get-url server)\wulifang\vendor" /MIR /R:0
18 changes: 18 additions & 0 deletions scripts/hiero_startup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding=UTF-8 -*-
# pyright: strict

from __future__ import absolute_import, division, print_function, unicode_literals


import hiero.core
import sys

TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Text


def install(p):
# type: (Text) -> None
sys.path.insert(0, p)
hiero.core.addPluginPath(p)
Loading

0 comments on commit 11af7e9

Please sign in to comment.