Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 409adda784 | |||
| f5f1c6a8d0 | |||
| 1eca91a030 | |||
| 6b872f11d9 | |||
| fd3742b800 | |||
| 870174a969 | |||
| 2c6dfcb340 | |||
| 4d3eacbe52 | |||
| df7d631b54 | |||
| 07ceb07058 | |||
| 112bc56ded | |||
| 88e2744e93 | |||
| ad1c201c79 | |||
| e18569f738 | |||
| f7e563f500 | |||
| 7e56c21395 | |||
| 30b701ee27 | |||
| 3cdbc09fc0 | |||
| 656e41f03c | |||
| 7da26e44b6 | |||
| 830ba842e0 | |||
| d38f990e75 | |||
| c01836806c | |||
| bf416dd228 | |||
| a2e2c489b4 | |||
| c40c2d7955 | |||
| b45aa0d6c1 | |||
| 667616b1fb | |||
| 87cb69090a | |||
| 4a8a0ca6c7 | |||
| 3c0d1eba65 | |||
| 14aaf4f064 | |||
| 10bf3e3af5 | |||
| 936d573510 | |||
| 1f886202ec | |||
| 479e5b5b98 | |||
| bed1ecf2cc | |||
| a6cbce977f |
+50
-31
@@ -20,9 +20,25 @@ jobs:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: ./
|
||||
- run:
|
||||
name: upgrade pip and install specklepy
|
||||
command: python -m pip install --upgrade pip & python -m pip install --target=.\modules specklepy
|
||||
- run:
|
||||
name: Install specklepy with python 3.7
|
||||
shell: powershell.exe
|
||||
command: |
|
||||
$pyarr=(python --version).split(' ')[1].split('.')
|
||||
$pyver=($pyarr[0..1] -join '.')
|
||||
echo "using python version:" $pyver
|
||||
$specklepy=(python patch_version.py)
|
||||
python -m pip install --target=./modules-$pyver specklepy==$specklepy
|
||||
- run:
|
||||
name: Install python 3.9 and specklepy
|
||||
shell: powershell.exe
|
||||
command: |
|
||||
choco install python --version=3.9.2
|
||||
$pyarr=(C:\Python39\python.exe --version).split(' ')[1].split('.')
|
||||
$pyver=($pyarr[0..1] -join '.')
|
||||
echo "using python version:" $pyver
|
||||
$specklepy=(python patch_version.py)
|
||||
C:\Python39\python.exe -m pip install --target=./modules-$pyver specklepy==$specklepy
|
||||
- run:
|
||||
name: Patch
|
||||
shell: powershell.exe
|
||||
@@ -36,13 +52,34 @@ jobs:
|
||||
# only create the yml if we have a tag
|
||||
New-Item -Force "speckle-sharp-ci-tools/Installers/blender/$channel.yml" -ItemType File -Value "version: $version"
|
||||
echo $version
|
||||
ls
|
||||
python patch_version.py $version
|
||||
speckle-sharp-ci-tools\InnoSetup\ISCC.exe speckle-sharp-ci-tools\blender.iss
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- speckle-sharp-ci-tools/Installers
|
||||
|
||||
|
||||
install-specklepy: # due to ujson dep, we need to match the py version to the install
|
||||
docker:
|
||||
- image: "cimg/python:<<parameters.tag>>"
|
||||
parameters:
|
||||
tag:
|
||||
default: "3.9"
|
||||
type: string
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: upgrade pip and install specklepy
|
||||
command: |
|
||||
specklepyver=$(python patch_version.py)
|
||||
echo installing specklepy $specklepyver
|
||||
python -m pip install --target=./modules-<<parameters.tag>> specklepy==$specklepyver
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- modules-*
|
||||
|
||||
get-ci-tools: # Clones our ci tools and persists them to the workspace
|
||||
docker:
|
||||
- image: cimg/base:2021.01
|
||||
@@ -54,10 +91,6 @@ jobs:
|
||||
root: ./
|
||||
paths:
|
||||
- speckle-sharp-ci-tools
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- speckle-sharp-ci-tools
|
||||
|
||||
deploy: # Uploads all installers found to S3
|
||||
docker:
|
||||
@@ -77,41 +110,27 @@ jobs:
|
||||
to: s3://speckle-releases/installers/
|
||||
|
||||
workflows:
|
||||
build:
|
||||
jobs:
|
||||
- get-ci-tools:
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
- /ci\/.*/
|
||||
|
||||
- build-connector:
|
||||
slug: blender
|
||||
requires:
|
||||
- get-ci-tools
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
- /ci\/.*/
|
||||
deploy:
|
||||
main:
|
||||
jobs:
|
||||
- get-ci-tools:
|
||||
filters:
|
||||
tags:
|
||||
only: /[0-9]+(\.[0-9]+)*/
|
||||
only: /.*/
|
||||
branches:
|
||||
ignore: /.*/ # For testing only! /ci\/.*/
|
||||
only:
|
||||
- main
|
||||
- /ci\/.*/
|
||||
- build-connector:
|
||||
slug: blender
|
||||
requires:
|
||||
- get-ci-tools
|
||||
filters:
|
||||
tags:
|
||||
only: /[0-9]+(\.[0-9]+)*/
|
||||
only: /.*/
|
||||
branches:
|
||||
ignore: /.*/ # For testing only! /ci\/.*/
|
||||
only:
|
||||
- main
|
||||
- /ci\/.*/
|
||||
- deploy:
|
||||
requires:
|
||||
- get-ci-tools
|
||||
|
||||
@@ -5,6 +5,7 @@ __pycache__/
|
||||
|
||||
# editor
|
||||
.vscode
|
||||
.idea
|
||||
|
||||
# dev
|
||||
.venv
|
||||
|
||||
@@ -208,17 +208,25 @@ def from_speckle_object(speckle_object, scale, name=None):
|
||||
|
||||
add_custom_properties(speckle_object, blender_object)
|
||||
add_blender_material(speckle_object, blender_object)
|
||||
# TODO: chat with tom re transforms
|
||||
# TODO: transforms
|
||||
# set_transform(speckle_object, blender_object)
|
||||
|
||||
return blender_object
|
||||
|
||||
# try display mesh
|
||||
mesh = getattr(
|
||||
display = getattr(
|
||||
speckle_object, "displayMesh", getattr(speckle_object, "displayValue", None)
|
||||
)
|
||||
if mesh:
|
||||
return from_speckle_object(mesh, scale, speckle_name)
|
||||
if display:
|
||||
# add parent type here so we can use it as a blender custom prop
|
||||
# not making it hidden, so it will get added on send as i think it might be helpful? can reconsider
|
||||
if isinstance(display, list):
|
||||
for item in display:
|
||||
item.parent_speckle_type = speckle_object.speckle_type
|
||||
from_speckle_object(item, scale)
|
||||
else:
|
||||
display.parent_speckle_type = speckle_object.speckle_type
|
||||
return from_speckle_object(display, scale, speckle_name)
|
||||
|
||||
# return none if fail
|
||||
_report("Invalid input: {}".format(speckle_object))
|
||||
|
||||
@@ -24,40 +24,18 @@ def add_faces(smesh, bmesh, smooth=False):
|
||||
|
||||
if sfaces and len(sfaces) > 0:
|
||||
i = 0
|
||||
# TODO: why does `faces.new()` seem to fail so often?
|
||||
while i < len(sfaces):
|
||||
if sfaces[i] == 0:
|
||||
i += 1
|
||||
try:
|
||||
f = bmesh.faces.new(
|
||||
(
|
||||
bmesh.verts[int(sfaces[i])],
|
||||
bmesh.verts[int(sfaces[i + 1])],
|
||||
bmesh.verts[int(sfaces[i + 2])],
|
||||
)
|
||||
)
|
||||
f.smooth = smooth
|
||||
except Exception as e:
|
||||
_report(f"Failed to create face for mesh {smesh.id} \n{e}")
|
||||
i += 3
|
||||
elif sfaces[i] == 1:
|
||||
i += 1
|
||||
try:
|
||||
f = bmesh.faces.new(
|
||||
(
|
||||
bmesh.verts[int(sfaces[i])],
|
||||
bmesh.verts[int(sfaces[i + 1])],
|
||||
bmesh.verts[int(sfaces[i + 2])],
|
||||
bmesh.verts[int(sfaces[i + 3])],
|
||||
)
|
||||
)
|
||||
f.smooth = smooth
|
||||
except Exception as e:
|
||||
_report(f"Failed to create face for mesh {smesh.id} \n{e}")
|
||||
i += 4
|
||||
else:
|
||||
print("Invalid face length.\n" + str(sfaces[i]))
|
||||
break
|
||||
n = sfaces[i]
|
||||
if n < 3:
|
||||
n += 3 # 0 -> 3, 1 -> 4
|
||||
|
||||
i += 1
|
||||
try:
|
||||
f = bmesh.faces.new([bmesh.verts[int(x)] for x in sfaces[i : i + n]])
|
||||
f.smooth = smooth
|
||||
except Exception as e:
|
||||
_report(f"Failed to create face for mesh {smesh.id} \n{e}")
|
||||
i += n
|
||||
|
||||
bmesh.faces.ensure_lookup_table()
|
||||
bmesh.verts.index_update()
|
||||
|
||||
@@ -14,8 +14,6 @@ def export_mesh(blender_object, data, scale=1.0):
|
||||
|
||||
verts = [tuple(mat @ x.co * scale) for x in data.vertices]
|
||||
|
||||
# TODO: add n-gon support, using tessfaces for now
|
||||
# faces = [x.vertices for x in data.loop_triangles]
|
||||
faces = [p.vertices for p in data.polygons]
|
||||
unit_system = bpy.context.scene.unit_settings.system
|
||||
|
||||
@@ -34,12 +32,13 @@ def export_mesh(blender_object, data, scale=1.0):
|
||||
sm.textureCoordinates.extend([vt.uv.x, vt.uv.y])
|
||||
|
||||
for f in faces:
|
||||
if len(f) == 3:
|
||||
n = len(f)
|
||||
if n == 3:
|
||||
sm.faces.append(0)
|
||||
elif len(f) == 4:
|
||||
elif n == 4:
|
||||
sm.faces.append(1)
|
||||
else:
|
||||
continue
|
||||
sm.faces.append(n)
|
||||
sm.faces.extend(f)
|
||||
|
||||
return [sm]
|
||||
|
||||
@@ -269,8 +269,14 @@ class ReceiveStreamObjects(bpy.types.Operator):
|
||||
|
||||
commit = branch.commits.items[int(bbranch.commit)]
|
||||
|
||||
transport = ServerTransport(client, stream.id)
|
||||
transport = ServerTransport(stream.id, client)
|
||||
stream_data = operations.receive(commit.referencedObject, transport)
|
||||
client.commit.received(
|
||||
bstream.id,
|
||||
commit.id,
|
||||
source_application="blender",
|
||||
message="received commit from Speckle Blender",
|
||||
)
|
||||
|
||||
"""
|
||||
Create or get Collection for stream objects
|
||||
@@ -434,7 +440,7 @@ class SendStreamObjects(bpy.types.Operator):
|
||||
hierarchy = get_collection_hierarchy(collection)
|
||||
create_nested_hierarchy(base, hierarchy, objects)
|
||||
|
||||
transport = ServerTransport(client, stream.id)
|
||||
transport = ServerTransport(stream.id, client)
|
||||
|
||||
obj_id = operations.send(
|
||||
base,
|
||||
|
||||
@@ -50,6 +50,7 @@ def get_specklepy_version():
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print(get_specklepy_version())
|
||||
return
|
||||
|
||||
tag = sys.argv[1]
|
||||
|
||||
Generated
+668
-240
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -7,13 +7,15 @@ license = "Apache-2.0"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.7,<3.8"
|
||||
specklepy = "2.3.5"
|
||||
specklepy = "^2.5.1"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
devtools = "^0.6.1"
|
||||
numpy = "^1.20.2"
|
||||
bpy = "^2.82.1"
|
||||
bpy-build = "^2.1.0"
|
||||
black = "^21.12b0"
|
||||
pylint = "^2.12.2"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
|
||||
Reference in New Issue
Block a user