feat: implement supported datablock
This commit is contained in:
parent
524c5a0813
commit
0d33c3eb3d
@ -167,8 +167,10 @@ class SessionProps(bpy.types.PropertyGroup):
|
||||
|
||||
if len(self.supported_datablock)>0:
|
||||
self.supported_datablock.clear()
|
||||
|
||||
for datablock,enabled in config["replicated_types"].items():
|
||||
rep_value = self.supported_datablock.add()
|
||||
rep_value.name = datablock
|
||||
rep_value.type_name = datablock
|
||||
rep_value.is_replicated = enabled
|
||||
|
||||
@ -182,11 +184,9 @@ class SessionProps(bpy.types.PropertyGroup):
|
||||
config["enable_presence"] = self.enable_presence
|
||||
config["client_color"] = [self.client_color.r,self.client_color.g,self.client_color.b]
|
||||
|
||||
rep_type = {}
|
||||
for bloc in self.supported_datablock:
|
||||
print(bloc.type_name)
|
||||
config["replicated_types"][bloc.type_name] = bloc.is_replicated
|
||||
|
||||
for bloc in self.supported_datablock:
|
||||
config["replicated_types"][bloc.type_name] = bloc.is_replicated
|
||||
|
||||
environment.save_config(config)
|
||||
|
||||
|
@ -18,10 +18,15 @@ SUBPROCESS_DIR = None
|
||||
DEFAULT_CONFIG = {
|
||||
"replicated_types": {
|
||||
'Client': True,
|
||||
'Image': True,
|
||||
'Texture': True,
|
||||
'Curve': True,
|
||||
'Material': True,
|
||||
'Light': True,
|
||||
'SunLight': True,
|
||||
'SpotLight': True,
|
||||
'AreaLight': True,
|
||||
'PointLight': True,
|
||||
'Camera': True,
|
||||
'Mesh': True,
|
||||
'Armature': True,
|
||||
|
@ -6,7 +6,7 @@ import json
|
||||
import bpy
|
||||
import mathutils
|
||||
|
||||
from . import draw
|
||||
from . import draw, environment
|
||||
from .libs import dump_anything
|
||||
|
||||
# TODO: replace hardcoded values...
|
||||
|
@ -90,6 +90,7 @@ def update_client_selected_object(context):
|
||||
|
||||
def init_datablocks():
|
||||
for datatype in helpers.BPY_TYPES.keys():
|
||||
if bpy.context.window_manager.session.supported_datablock[datatype].is_replicated:
|
||||
for item in getattr(bpy.data, helpers.BPY_TYPES[datatype]):
|
||||
item.id = bpy.context.window_manager.session.username
|
||||
key = "{}/{}".format(datatype, item.name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user