Spaces:
Runtime error
Runtime error
Commit
·
0282daa
1
Parent(s):
373bf3b
feat: add bevel depth option
Browse filesFormer-commit-id: 86de47fdbbc248842e924e25c5436f42d97b865a
- create-3d-icon.py +7 -0
- poetry.lock +13 -1
- pyproject.toml +1 -0
create-3d-icon.py
CHANGED
@@ -35,6 +35,9 @@ def main():
|
|
35 |
type=float, default=-1)
|
36 |
parser.add_argument(
|
37 |
"--size", help="size of the image", type=int, default=2048)
|
|
|
|
|
|
|
38 |
args = parser.parse_args()
|
39 |
|
40 |
filepath = args.filepath
|
@@ -51,6 +54,7 @@ def main():
|
|
51 |
color_g = args.g
|
52 |
color_b = args.b
|
53 |
size = args.size
|
|
|
54 |
|
55 |
capture(
|
56 |
filepath,
|
@@ -58,6 +62,7 @@ def main():
|
|
58 |
rotate_y,
|
59 |
rotate_z,
|
60 |
thickness,
|
|
|
61 |
distance,
|
62 |
light_x,
|
63 |
light_y,
|
@@ -78,6 +83,7 @@ def capture(
|
|
78 |
rotate_y=0,
|
79 |
rotate_z=0,
|
80 |
thickness=1,
|
|
|
81 |
distance=1,
|
82 |
light_x=0,
|
83 |
light_y=0,
|
@@ -119,6 +125,7 @@ def capture(
|
|
119 |
|
120 |
for obj in collection.objects:
|
121 |
obj.data.extrude = thickness * 0.0005
|
|
|
122 |
if color_r != -1 or color_g != -1 or color_b != -1:
|
123 |
obj.active_material = material
|
124 |
|
|
|
35 |
type=float, default=-1)
|
36 |
parser.add_argument(
|
37 |
"--size", help="size of the image", type=int, default=2048)
|
38 |
+
parser.add_argument(
|
39 |
+
"--bevel", help="bevel depth of the icon", type=float, default=1
|
40 |
+
)
|
41 |
args = parser.parse_args()
|
42 |
|
43 |
filepath = args.filepath
|
|
|
54 |
color_g = args.g
|
55 |
color_b = args.b
|
56 |
size = args.size
|
57 |
+
bevel = args.bevel
|
58 |
|
59 |
capture(
|
60 |
filepath,
|
|
|
62 |
rotate_y,
|
63 |
rotate_z,
|
64 |
thickness,
|
65 |
+
bevel,
|
66 |
distance,
|
67 |
light_x,
|
68 |
light_y,
|
|
|
83 |
rotate_y=0,
|
84 |
rotate_z=0,
|
85 |
thickness=1,
|
86 |
+
bevel=1,
|
87 |
distance=1,
|
88 |
light_x=0,
|
89 |
light_y=0,
|
|
|
125 |
|
126 |
for obj in collection.objects:
|
127 |
obj.data.extrude = thickness * 0.0005
|
128 |
+
obj.data.bevel_depth = bevel * 0.0001
|
129 |
if color_r != -1 or color_g != -1 or color_b != -1:
|
130 |
obj.active_material = material
|
131 |
|
poetry.lock
CHANGED
@@ -273,6 +273,18 @@ files = [
|
|
273 |
{file = "Cython-0.29.33.tar.gz", hash = "sha256:5040764c4a4d2ce964a395da24f0d1ae58144995dab92c6b96f44c3f4d72286a"},
|
274 |
]
|
275 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
[[package]]
|
277 |
name = "idna"
|
278 |
version = "3.4"
|
@@ -468,4 +480,4 @@ cffi = ["cffi (>=1.11)"]
|
|
468 |
[metadata]
|
469 |
lock-version = "2.0"
|
470 |
python-versions = "~3.10"
|
471 |
-
content-hash = "
|
|
|
273 |
{file = "Cython-0.29.33.tar.gz", hash = "sha256:5040764c4a4d2ce964a395da24f0d1ae58144995dab92c6b96f44c3f4d72286a"},
|
274 |
]
|
275 |
|
276 |
+
[[package]]
|
277 |
+
name = "fake-bpy-module-latest"
|
278 |
+
version = "20230216"
|
279 |
+
description = "Collection of the fake Blender Python API module for the code completion."
|
280 |
+
category = "main"
|
281 |
+
optional = false
|
282 |
+
python-versions = ">=3.7"
|
283 |
+
files = [
|
284 |
+
{file = "fake-bpy-module-latest-20230216.tar.gz", hash = "sha256:64de4ba9010f08073c0b6649989d9272af6f7aa6f054f6c6afa09a56ef48d4eb"},
|
285 |
+
{file = "fake_bpy_module_latest-20230216-py3-none-any.whl", hash = "sha256:b7a031c82f0b307c3ac53662d50aaf34dc071fbec2e03066953eb4b9a52ba136"},
|
286 |
+
]
|
287 |
+
|
288 |
[[package]]
|
289 |
name = "idna"
|
290 |
version = "3.4"
|
|
|
480 |
[metadata]
|
481 |
lock-version = "2.0"
|
482 |
python-versions = "~3.10"
|
483 |
+
content-hash = "92f2dc8f122e28a0efd3cdd652bf25c9e93c32650c8cb1eea2e1e956f3dea997"
|
pyproject.toml
CHANGED
@@ -13,6 +13,7 @@ bpy = "^3.4.0"
|
|
13 |
|
14 |
[tool.poetry.group.dev.dependencies]
|
15 |
autopep8 = "^2.0.1"
|
|
|
16 |
|
17 |
[build-system]
|
18 |
requires = ["poetry-core"]
|
|
|
13 |
|
14 |
[tool.poetry.group.dev.dependencies]
|
15 |
autopep8 = "^2.0.1"
|
16 |
+
fake-bpy-module-latest = "^20230216"
|
17 |
|
18 |
[build-system]
|
19 |
requires = ["poetry-core"]
|