Skip to content

Commit d2223fb

Browse files
Better Point Cloud and Curves support (#57)
* better support for Point Clouds and Curves * update docs * ruff format * only suport >=4.5 * don't test blender <4.5 * remove _inv * update .gitignore * remove generated api docs files * Update .gitignore * cleanup * remove bpy from dependencies * doc for self.data * bump uv.lock
1 parent f6e2ff5 commit d2223fb

28 files changed

+843
-864
lines changed

.github/workflows/test-in-blender.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
max-parallel: 4
1414
fail-fast: false
1515
matrix:
16-
version: ["4.2", "4.3", "4.4", "4.5", "daily"]
16+
version: ["4.5", "daily"]
1717
os: [macos-14, ubuntu-latest, windows-latest]
1818
steps:
1919
- uses: actions/checkout@v4

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
max-parallel: 4
1414
fail-fast: false
1515
matrix:
16-
version: [4.2, 4.3, 4.4, 4.5]
16+
version: [4.5]
1717
os: [macos-latest, windows-latest, ubuntu-latest]
1818
steps:
1919
- uses: actions/checkout@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
*.quarto_ipynb
1313
/docs/api
1414
/build
15+
.DS_Store
16+
/docs/_inv
17+
docs/objects.txt

databpy/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
from .object import (
22
ObjectTracker,
33
BlenderObject,
4+
BOB,
45
create_object,
56
create_bob,
7+
create_mesh_object,
8+
create_curves_object,
9+
create_pointcloud_object,
610
LinkedObjectError,
711
bdo,
812
)
@@ -32,8 +36,12 @@
3236
__all__ = [
3337
"ObjectTracker",
3438
"BlenderObject",
39+
"BOB",
3540
"create_object",
3641
"create_bob",
42+
"create_mesh_object",
43+
"create_curves_object",
44+
"create_pointcloud_object",
3745
"LinkedObjectError",
3846
"bdo",
3947
"import_vdb",

databpy/attribute.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,9 +695,16 @@ def store_named_attribute(
695695
# is the case For now we will set a single vert to it's own position, which triggers a
696696
# proper refresh of the object data.
697697
try:
698-
obj.data.vertices[0].co = obj.data.vertices[0].co # type: ignore
698+
obj_data.vertices[0].co = obj.data.vertices[0].co # type: ignore
699699
except AttributeError:
700-
obj.data.update() # type: ignore
700+
# For non-mesh objects (Curves, PointCloud), try update() if it exists
701+
try:
702+
obj_data.attributes["position"].data[0].vector = (
703+
obj_data.attributes["position"].data[0].vector
704+
)
705+
except AttributeError:
706+
if hasattr(obj.data, "update"):
707+
obj_data.update() # type: ignore
701708

702709
return attribute
703710

0 commit comments

Comments
 (0)