Compare commits
No commits in common. "develop" and "master" have entirely different histories.
@ -1,7 +1,13 @@
|
|||||||
stages:
|
stages:
|
||||||
|
- test
|
||||||
- build
|
- build
|
||||||
|
- deploy
|
||||||
|
- doc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
include:
|
include:
|
||||||
|
- local: .gitlab/ci/test.gitlab-ci.yml
|
||||||
- local: .gitlab/ci/build.gitlab-ci.yml
|
- local: .gitlab/ci/build.gitlab-ci.yml
|
||||||
|
- local: .gitlab/ci/deploy.gitlab-ci.yml
|
||||||
|
- local: .gitlab/ci/doc.gitlab-ci.yml
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
needs: ["test"]
|
||||||
image: debian:stable-slim
|
image: debian:stable-slim
|
||||||
script:
|
script:
|
||||||
- rm -rf tests .git .gitignore script
|
- rm -rf tests .git .gitignore script
|
||||||
|
7
.gitlab/ci/test.gitlab-ci.yml
Normal file
7
.gitlab/ci/test.gitlab-ci.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
image: slumber/blender-addon-testing:latest
|
||||||
|
script:
|
||||||
|
- python3 scripts/test_addon.py
|
||||||
|
variables:
|
||||||
|
GIT_SUBMODULE_STRATEGY: recursive
|
@ -19,7 +19,7 @@
|
|||||||
bl_info = {
|
bl_info = {
|
||||||
"name": "Multi-User",
|
"name": "Multi-User",
|
||||||
"author": "Swann Martinez",
|
"author": "Swann Martinez",
|
||||||
"version": (0, 6, 0),
|
"version": (0, 5, 8),
|
||||||
"description": "Enable real-time collaborative workflow inside blender",
|
"description": "Enable real-time collaborative workflow inside blender",
|
||||||
"blender": (2, 82, 0),
|
"blender": (2, 82, 0),
|
||||||
"location": "3D View > Sidebar > Multi-User tab",
|
"location": "3D View > Sidebar > Multi-User tab",
|
||||||
|
@ -245,8 +245,9 @@ def dump_node_tree(node_tree: bpy.types.ShaderNodeTree) -> dict:
|
|||||||
'type': type(node_tree).__name__
|
'type': type(node_tree).__name__
|
||||||
}
|
}
|
||||||
|
|
||||||
sockets = [item for item in node_tree.interface.items_tree if item.item_type == 'SOCKET']
|
for socket_id in ['inputs', 'outputs']:
|
||||||
node_tree_data['interface'] = dump_node_tree_sockets(sockets)
|
socket_collection = getattr(node_tree, socket_id)
|
||||||
|
node_tree_data[socket_id] = dump_node_tree_sockets(socket_collection)
|
||||||
|
|
||||||
return node_tree_data
|
return node_tree_data
|
||||||
|
|
||||||
@ -262,18 +263,18 @@ def dump_node_tree_sockets(sockets: bpy.types.Collection) -> dict:
|
|||||||
"""
|
"""
|
||||||
sockets_data = []
|
sockets_data = []
|
||||||
for socket in sockets:
|
for socket in sockets:
|
||||||
sockets_data.append(
|
try:
|
||||||
(
|
socket_uuid = socket['uuid']
|
||||||
socket.name,
|
except Exception:
|
||||||
socket.socket_type,
|
socket_uuid = str(uuid4())
|
||||||
socket.in_out
|
socket['uuid'] = socket_uuid
|
||||||
)
|
|
||||||
)
|
sockets_data.append((socket.name, socket.bl_socket_idname, socket_uuid))
|
||||||
|
|
||||||
return sockets_data
|
return sockets_data
|
||||||
|
|
||||||
|
|
||||||
def load_node_tree_sockets(interface: bpy.types.NodeTreeInterface,
|
def load_node_tree_sockets(sockets: bpy.types.Collection,
|
||||||
sockets_data: dict):
|
sockets_data: dict):
|
||||||
""" load sockets of a shader_node_tree
|
""" load sockets of a shader_node_tree
|
||||||
|
|
||||||
@ -284,17 +285,20 @@ def load_node_tree_sockets(interface: bpy.types.NodeTreeInterface,
|
|||||||
:arg socket_data: dumped socket data
|
:arg socket_data: dumped socket data
|
||||||
:type socket_data: dict
|
:type socket_data: dict
|
||||||
"""
|
"""
|
||||||
# Remove old sockets
|
# Check for removed sockets
|
||||||
interface.clear()
|
for socket in sockets:
|
||||||
|
if not [s for s in sockets_data if 'uuid' in socket and socket['uuid'] == s[2]]:
|
||||||
|
sockets.remove(socket)
|
||||||
|
|
||||||
# Check for new sockets
|
# Check for new sockets
|
||||||
for name, socket_type, in_out in sockets_data:
|
for idx, socket_data in enumerate(sockets_data):
|
||||||
socket = interface.new_socket(
|
try:
|
||||||
name,
|
checked_socket = sockets[idx]
|
||||||
in_out=in_out,
|
if checked_socket.name != socket_data[0]:
|
||||||
socket_type=socket_type
|
checked_socket.name = socket_data[0]
|
||||||
)
|
except Exception:
|
||||||
|
s = sockets.new(socket_data[1], socket_data[0])
|
||||||
|
s['uuid'] = socket_data[2]
|
||||||
|
|
||||||
|
|
||||||
def load_node_tree(node_tree_data: dict, target_node_tree: bpy.types.ShaderNodeTree) -> dict:
|
def load_node_tree(node_tree_data: dict, target_node_tree: bpy.types.ShaderNodeTree) -> dict:
|
||||||
@ -311,8 +315,13 @@ def load_node_tree(node_tree_data: dict, target_node_tree: bpy.types.ShaderNodeT
|
|||||||
if not target_node_tree.is_property_readonly('name'):
|
if not target_node_tree.is_property_readonly('name'):
|
||||||
target_node_tree.name = node_tree_data['name']
|
target_node_tree.name = node_tree_data['name']
|
||||||
|
|
||||||
if 'interface' in node_tree_data:
|
if 'inputs' in node_tree_data:
|
||||||
load_node_tree_sockets(target_node_tree.interface, node_tree_data['interface'])
|
socket_collection = getattr(target_node_tree, 'inputs')
|
||||||
|
load_node_tree_sockets(socket_collection, node_tree_data['inputs'])
|
||||||
|
|
||||||
|
if 'outputs' in node_tree_data:
|
||||||
|
socket_collection = getattr(target_node_tree, 'outputs')
|
||||||
|
load_node_tree_sockets(socket_collection, node_tree_data['outputs'])
|
||||||
|
|
||||||
# Load nodes
|
# Load nodes
|
||||||
for node in node_tree_data["nodes"]:
|
for node in node_tree_data["nodes"]:
|
||||||
|
@ -37,8 +37,8 @@ VERTICE = ['co']
|
|||||||
|
|
||||||
EDGE = [
|
EDGE = [
|
||||||
'vertices',
|
'vertices',
|
||||||
# 'crease',
|
'crease',
|
||||||
# 'bevel_weight',
|
'bevel_weight',
|
||||||
'use_seam',
|
'use_seam',
|
||||||
'use_edge_sharp',
|
'use_edge_sharp',
|
||||||
]
|
]
|
||||||
|
@ -253,9 +253,11 @@ class Widget(object):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def configure_bgl(self):
|
def configure_bgl(self):
|
||||||
gpu.state.blend_set('ALPHA')
|
bgl.glLineWidth(2.)
|
||||||
gpu.state.depth_test_set('LESS_EQUAL')
|
bgl.glEnable(bgl.GL_DEPTH_TEST)
|
||||||
gpu.state.line_width_set(2.0)
|
bgl.glEnable(bgl.GL_BLEND)
|
||||||
|
bgl.glEnable(bgl.GL_LINE_SMOOTH)
|
||||||
|
|
||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
"""How to draw the widget
|
"""How to draw the widget
|
||||||
@ -298,7 +300,7 @@ class UserFrustumWidget(Widget):
|
|||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
location = self.data.get('view_corners')
|
location = self.data.get('view_corners')
|
||||||
shader = gpu.shader.from_builtin('UNIFORM_COLOR')
|
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
||||||
positions = [tuple(coord) for coord in location]
|
positions = [tuple(coord) for coord in location]
|
||||||
|
|
||||||
if len(positions) != 7:
|
if len(positions) != 7:
|
||||||
@ -370,7 +372,7 @@ class UserSelectionWidget(Widget):
|
|||||||
vertex_pos += bbox_pos
|
vertex_pos += bbox_pos
|
||||||
vertex_ind += bbox_ind
|
vertex_ind += bbox_ind
|
||||||
|
|
||||||
shader = gpu.shader.from_builtin('UNIFORM_COLOR')
|
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
|
||||||
batch = batch_for_shader(
|
batch = batch_for_shader(
|
||||||
shader,
|
shader,
|
||||||
'LINES',
|
'LINES',
|
||||||
@ -419,7 +421,7 @@ class UserNameWidget(Widget):
|
|||||||
|
|
||||||
if coords:
|
if coords:
|
||||||
blf.position(0, coords[0], coords[1]+10, 0)
|
blf.position(0, coords[0], coords[1]+10, 0)
|
||||||
blf.size(0, 16)
|
blf.size(0, 16, 72)
|
||||||
blf.color(0, color[0], color[1], color[2], color[3])
|
blf.color(0, color[0], color[1], color[2], color[3])
|
||||||
blf.draw(0, self.username)
|
blf.draw(0, self.username)
|
||||||
|
|
||||||
@ -509,7 +511,7 @@ class SessionStatusWidget(Widget):
|
|||||||
vpos = (self.preferences.presence_hud_vpos*bpy.context.area.height)/100
|
vpos = (self.preferences.presence_hud_vpos*bpy.context.area.height)/100
|
||||||
|
|
||||||
blf.position(0, hpos, vpos, 0)
|
blf.position(0, hpos, vpos, 0)
|
||||||
blf.size(0, int(text_scale*ui_scale))
|
blf.size(0, int(text_scale*ui_scale), 72)
|
||||||
blf.color(0, color[0], color[1], color[2], color[3])
|
blf.color(0, color[0], color[1], color[2], color[3])
|
||||||
blf.draw(0, state_str)
|
blf.draw(0, state_str)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user