feat: disable autopush for meshes

refactor: remove prints
This commit is contained in:
Swann Martinez 2019-08-28 12:57:09 +02:00
parent 7406843ce1
commit b3435eae56
No known key found for this signature in database
GPG Key ID: 414CCAFD8DA720E1
16 changed files with 23 additions and 11 deletions

View File

@ -207,7 +207,6 @@ def load_handler(dummy):
def register():
if libs not in sys.path:
sys.path.append(libs)
print(libs)
environment.setup(DEPENDENCIES,bpy.app.binary_path_python)

View File

@ -36,3 +36,4 @@ bl_class = bpy.types.Camera
bl_rep_class = BlCamera
bl_delay_refresh = 1
bl_delay_apply = 1
bl_automatic_push = True

View File

@ -69,3 +69,4 @@ bl_class = bpy.types.Collection
bl_rep_class = BlCollection
bl_delay_refresh = 1
bl_delay_apply = 1
bl_automatic_push = True

View File

@ -57,3 +57,4 @@ bl_class = bpy.types.Curve
bl_rep_class = BlCurve
bl_delay_refresh = 1
bl_delay_apply = 1
bl_automatic_push = True

View File

@ -91,3 +91,4 @@ bl_class = bpy.types.GreasePencil
bl_rep_class = BlGpencil
bl_delay_refresh = 5
bl_delay_apply = 5
bl_automatic_push = True

View File

@ -20,7 +20,6 @@ def dump_image(image):
pixels = file.read()
else:
raise ValueError()
print("Image format not supported ")
return pixels
class BlImage(BlDatablock):
@ -74,3 +73,4 @@ bl_class = bpy.types.Image
bl_rep_class = BlImage
bl_delay_refresh = 0
bl_delay_apply = 0
bl_automatic_push = False

View File

@ -37,3 +37,4 @@ bl_class = bpy.types.Light
bl_rep_class = BlLight
bl_delay_refresh = 1
bl_delay_apply = 1
bl_automatic_push = True

View File

@ -104,3 +104,4 @@ bl_class = bpy.types.Material
bl_rep_class = BlMaterial
bl_delay_refresh = 5
bl_delay_apply = 5
bl_automatic_push = True

View File

@ -180,3 +180,4 @@ bl_class = bpy.types.Mesh
bl_rep_class = BlMesh
bl_delay_refresh = 10
bl_delay_apply = 10
bl_automatic_push = False

View File

@ -85,3 +85,4 @@ bl_class = bpy.types.Object
bl_rep_class = BlObject
bl_delay_refresh = 1
bl_delay_apply = 1
bl_automatic_push = True

View File

@ -76,3 +76,4 @@ bl_class = bpy.types.Scene
bl_rep_class = BlScene
bl_delay_refresh = 1
bl_delay_apply = 1
bl_automatic_push = True

View File

@ -56,3 +56,4 @@ bl_class = presence.User
bl_rep_class = BlUser
bl_delay_refresh = 1
bl_delay_apply = 1
bl_automatic_push = True

View File

@ -1,10 +1,12 @@
import bpy
import logging
from . import operators, utils
from .bl_types.bl_user import BlUser
from .libs import debug
from .libs.replication.replication.constants import FETCHED
logger = logging.getLogger(__name__)
class Delayable():
"""Delayable task interface
@ -45,7 +47,7 @@ class Timer(Delayable):
try:
bpy.app.timers.unregister(self.execute)
except:
print("timer already unregistered")
logger.error("timer already unregistered")
class ApplyTimer(Timer):
@ -84,7 +86,7 @@ class Draw(Delayable):
bpy.types.SpaceView3D.draw_handler_remove(
self._handler, "WINDOW")
except:
print("draw already unregistered")
logger.error("draw already unregistered")
class ClientUpdate(Draw):

@ -1 +1 @@
Subproject commit 2be0c0d1fc59b9903de8d7da5f2055243ea70175
Subproject commit 1e24adc35057aab418878961f185e200a468411e

View File

@ -78,7 +78,7 @@ class SessionStartOperator(bpy.types.Operator):
_type.bl_class,
_type.bl_rep_class,
timer=_type.bl_delay_refresh,
automatic=True)
automatic=_type.bl_automatic_push)
if _type.bl_delay_apply > 0:
delayables.append(delayable.ApplyTimer(

View File

@ -4,7 +4,7 @@ import blf
import gpu
import mathutils
import copy
import logging
import math
@ -17,6 +17,7 @@ from gpu_extras.batch import batch_for_shader
global renderer
logger = logging.getLogger(__name__)
def view3d_find():
for area in bpy.data.window_managers[0].windows[0].screen.areas:
@ -222,7 +223,7 @@ class DrawFactory(object):
self.d2d_items[client_uuid] = (position[1], client_uuid, color)
except Exception as e:
print("Draw client exception {}".format(e))
logger.error("Draw client exception {}".format(e))
def draw3d_callback(self):
bgl.glLineWidth(1.5)
@ -232,7 +233,7 @@ class DrawFactory(object):
shader.uniform_float("color", color)
batch.draw(shader)
except Exception:
print("3D Exception")
logger.error("3D Exception")
def draw2d_callback(self):
for position, font, color in self.d2d_items.values():
@ -246,7 +247,7 @@ class DrawFactory(object):
blf.draw(0, font)
except Exception:
print("2D EXCEPTION")
logger.error("2D EXCEPTION")
def register():