-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: include saturday06/starry-bpy-type-stubs
- Loading branch information
1 parent
543b1e0
commit 39e73b6
Showing
46 changed files
with
3,469 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ | |
!/tools/*.wsb | ||
!/tests/ruff.toml | ||
!/tests/resources | ||
!/typings/ruff.toml | ||
|
||
*.blend1 | ||
*~ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,18 @@ description = "" | |
authors = ["Isamu Mogi <[email protected]>", "iCyP"] | ||
license = "MIT" | ||
|
||
packages = [ | ||
{ include = "*", from = "src" }, | ||
{ include = "bgl-stubs", from = "typings" }, | ||
{ include = "bmesh-stubs", from = "typings" }, | ||
{ include = "bpy-stubs", from = "typings" }, | ||
{ include = "bpy_extras-stubs", from = "typings" }, | ||
{ include = "gpu-stubs", from = "typings" }, | ||
{ include = "gpu_extras-stubs", from = "typings" }, | ||
{ include = "idprop-stubs", from = "typings" }, | ||
{ include = "mathutils-stubs", from = "typings" }, | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "3.10.*" # I actually want to use 3.9, but bpy 3.6.* doesn't allow it. | ||
|
||
|
@@ -25,12 +37,11 @@ dulwich = "*" | |
mypy = "*" | ||
pyright = "*" | ||
ruff = "*" | ||
starry-bpy-type-stubs = { git = "https://github.com/saturday06/starry-bpy-type-stubs.git" } | ||
tqdm = "*" | ||
types-tqdm = "*" | ||
|
||
[tool.ruff] | ||
src = ["src"] | ||
src = ["typings", "src"] | ||
|
||
[tool.ruff.lint] | ||
allowed-confusables = [ | ||
|
@@ -122,7 +133,7 @@ ignore-regex = ".* # codespell-ignore" | |
|
||
[tool.mypy] | ||
python_version = "3.9" | ||
mypy_path = "$MYPY_CONFIG_FILE_DIR/src" | ||
mypy_path = "$MYPY_CONFIG_FILE_DIR/typings:$MYPY_CONFIG_FILE_DIR/src" | ||
strict = true | ||
disallow_any_unimported = true | ||
disallow_any_decorated = true | ||
|
@@ -145,7 +156,6 @@ typeCheckingMode = "strict" | |
reportMissingModuleSource = false | ||
reportCallInDefaultInitializer = true | ||
reportImplicitStringConcatenation = true | ||
reportPropertyTypeMismatch = true | ||
reportShadowedImports = true | ||
|
||
[build-system] | ||
|
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
GL_BACK: int | ||
GL_BLEND: int | ||
GL_CLAMP_TO_EDGE: int | ||
GL_COLOR_BUFFER_BIT: int | ||
GL_CULL_FACE: int | ||
GL_DEPTH_BUFFER_BIT: int | ||
GL_DEPTH_TEST: int | ||
GL_ONE: int | ||
GL_ONE_MINUS_SRC_ALPHA: int | ||
GL_SRC_ALPHA: int | ||
GL_TEXTURE0: int | ||
GL_TEXTURE1: int | ||
GL_TEXTURE_2D: int | ||
GL_TEXTURE_WRAP_S: int | ||
GL_TEXTURE_WRAP_T: int | ||
GL_TRUE: int | ||
GL_ZERO: int | ||
|
||
def glClearColor(red: float, green: float, blue: float, alpha: float) -> None: ... | ||
def glClear(mask: int) -> None: ... | ||
def glEnable(cap: int) -> None: ... | ||
def glDisable(cap: int) -> None: ... | ||
def glBlendFunc(sfactor: int, dfactor: int) -> None: ... | ||
def glDepthMask(flag: int) -> None: ... | ||
def glCullFace(mode: int) -> None: ... | ||
def glActiveTexture(texture: int) -> None: ... | ||
def glBindTexture(target: int, texture: int) -> None: ... | ||
def glTexParameteri(target: int, pname: int, param: int) -> None: ... |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from . import ops as ops | ||
from . import types as types | ||
|
||
def new(use_operators: bool = True) -> types.BMesh: ... |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from bmesh.types import BMesh, BMFaceSeq | ||
|
||
def recalc_face_normals( | ||
bm: BMesh, | ||
/, | ||
*, | ||
faces: BMFaceSeq = ..., | ||
) -> set[str]: ... |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
from collections.abc import Iterator, Sequence | ||
from typing import Generic, Optional, TypeVar | ||
|
||
from bpy.types import Mesh | ||
from mathutils import Vector | ||
|
||
__BMElemSeqElement = TypeVar("__BMElemSeqElement") | ||
|
||
class BMElemSeq(Generic[__BMElemSeqElement]): | ||
def __len__(self) -> int: ... | ||
def __getitem__(self, key: int) -> __BMElemSeqElement: ... | ||
def __iter__(self) -> Iterator[__BMElemSeqElement]: ... | ||
|
||
class BMLoopUV: | ||
uv: Vector | ||
|
||
class BMVert: | ||
index: int | ||
co: Vector | ||
|
||
def __getitem__( | ||
self, | ||
value: BMLoopUV, | ||
) -> Vector: ... # ドキュメントには存在しない | ||
|
||
class BMLayerItem: | ||
def copy_from(self, other: BMLayerItem) -> None: ... | ||
@property | ||
def name(self) -> str: ... | ||
|
||
class BMLayerCollection: | ||
def __getitem__(self, key: str) -> BMLoopUV: ... # ドキュメントに記載はない? | ||
def keys(self) -> Iterator[str]: ... | ||
def values(self) -> Iterator[BMLayerItem]: ... | ||
def items(self) -> Iterator[tuple[str, BMLayerItem]]: ... | ||
|
||
class BMLayerAccessLoop: | ||
uv: BMLayerCollection | ||
|
||
class BMLayerAccessVert: | ||
shape: BMLayerCollection | ||
|
||
class BMVertSeq: | ||
def new( | ||
self, | ||
co: Sequence[float] = (0.0, 0.0, 0.0), | ||
example: Optional[BMVert] = None, | ||
) -> BMVert: ... | ||
@property | ||
def layers(self) -> BMLayerAccessVert: ... | ||
|
||
class BMEdge: ... | ||
|
||
class BMEdgeSeq: | ||
def new( | ||
self, | ||
verts: tuple[ | ||
BMVert, | ||
BMVert, | ||
], # 実際にはSequenceだと思うが、2要素チェックをしたいのでtuple | ||
example: Optional[BMEdge] = None, | ||
) -> BMEdge: ... | ||
|
||
class BMLoop: | ||
index: int | ||
@property | ||
def face(self) -> BMFace: ... | ||
@property | ||
def vert(self) -> BMVert: ... | ||
def __getitem__( | ||
self, | ||
uv: BMLoopUV, | ||
) -> BMLoopUV: ... # TODO: ドキュメントに存在しない | ||
|
||
class BMLoopSeq: | ||
@property | ||
def layers(self) -> BMLayerAccessLoop: ... | ||
|
||
class BMFace: | ||
material_index: int | ||
@property | ||
def loops(self) -> BMElemSeq[BMLoop]: ... | ||
|
||
class BMFaceSeq: | ||
def new( | ||
self, | ||
verts: Sequence[BMVert], | ||
example: Optional[BMFace] = None, | ||
) -> BMFace: ... | ||
def __iter__(self) -> Iterator[BMFace]: ... | ||
|
||
class BMesh: | ||
@property | ||
def faces(self) -> BMFaceSeq: ... | ||
@property | ||
def edges(self) -> BMEdgeSeq: ... | ||
@property | ||
def verts(self) -> BMVertSeq: ... | ||
@property | ||
def loops(self) -> BMLoopSeq: ... | ||
def free(self) -> None: ... | ||
def to_mesh(self, mesh: Mesh) -> None: ... | ||
def from_mesh( | ||
self, | ||
mesh: Mesh, | ||
face_normals: bool = True, | ||
use_shape_key: bool = False, | ||
shape_key_index: int = 0, | ||
) -> None: ... | ||
def calc_loop_triangles(self) -> list[tuple[BMLoop, ...]]: ... # TODO: 正しい型 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from . import app as app | ||
from . import msgbus as msgbus | ||
from . import ops as ops | ||
from . import props as props | ||
from . import types as types | ||
from . import utils as utils | ||
|
||
context: types.Context | ||
data: types.BlendData |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from . import handlers as handlers | ||
from . import timers as timers | ||
from . import translations as translations | ||
|
||
debug: bool | ||
debug_depsgraph: bool | ||
debug_depsgraph_build: bool | ||
debug_depsgraph_eval: bool | ||
debug_depsgraph_pretty: bool | ||
debug_depsgraph_tag: bool | ||
debug_depsgraph_time: bool | ||
debug_events: bool | ||
debug_ffmpeg: bool | ||
debug_freestyle: bool | ||
debug_handlers: bool | ||
debug_io: bool | ||
debug_python: bool | ||
debug_simdata: bool | ||
debug_value: bool | ||
debug_wm: bool | ||
tempdir: str | ||
use_event_simulate: bool | ||
build_platform: bytes | ||
build_type: bytes | ||
version_cycle: str | ||
version: tuple[int, int, int] | ||
binary_path: str |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from collections.abc import MutableSequence | ||
from typing import Callable | ||
|
||
def persistent(function: Callable[[object], None]) -> Callable[[object], None]: ... | ||
|
||
# TODO: 引数の型を調べる | ||
depsgraph_update_pre: MutableSequence[Callable[[object], None]] | ||
depsgraph_update_post: MutableSequence[Callable[[object], None]] | ||
|
||
save_pre: MutableSequence[Callable[[object], None]] | ||
frame_change_pre: MutableSequence[Callable[[object], None]] | ||
frame_change_post: MutableSequence[Callable[[object], None]] | ||
load_post: MutableSequence[Callable[[object], None]] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from typing import Callable, Optional | ||
|
||
def register( | ||
function: Callable[[], Optional[float]], | ||
first_interval: float = 0, | ||
persistent: bool = False, | ||
) -> None: ... | ||
def is_registered(function: Callable[[], Optional[float]]) -> bool: ... |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from typing import Optional | ||
|
||
locale: str | ||
|
||
def pgettext(msgid: str, msgctxt: Optional[str] = None) -> str: ... | ||
def unregister(module_name: str) -> None: ... | ||
def register( | ||
module_name: str, | ||
dictionary: dict[str, dict[tuple[str, str], str]], | ||
) -> None: ... |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import preferences as preferences |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import view as view |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use_translate_interface: bool |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# TODO: 正しい型 | ||
def subscribe_rna( | ||
key: object, | ||
owner: object, | ||
args: object, | ||
notify: object, | ||
options: set[str] = ..., | ||
) -> None: ... | ||
def publish_rna(key: object) -> None: ... | ||
def clear_by_owner(owner: object) -> None: ... |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from . import export_scene as export_scene | ||
from . import icyp as icyp | ||
from . import import_scene as import_scene | ||
from . import mesh as mesh | ||
from . import object as object | ||
from . import outliner as outliner | ||
from . import preferences as preferences | ||
from . import uv as uv | ||
from . import vrm as vrm | ||
from . import wm as wm |
Oops, something went wrong.