diff --git a/blenderkit/__init__.py b/blenderkit/__init__.py index 145e0fc8c670ad1035ea04e53032e90e07332560..d7591d66584f32b6cc3477ec3489c6840e6dd593 100644 --- a/blenderkit/__init__.py +++ b/blenderkit/__init__.py @@ -574,7 +574,7 @@ class BlenderKitCommonSearchProps(object): def name_update(self, context): ''' checks for name change, because it decides if whole asset has to be re-uploaded. Name is stored in the blend file and that's the reason.''' - utils.name_update(self.blenderkit) + utils.name_update(self) diff --git a/blenderkit/append_link.py b/blenderkit/append_link.py index 8ec861c93e960a4e98760e8800c0edf13b488fc1..a8b5c7185dbf0a5081ed908206f1d5e7bde79ce3 100644 --- a/blenderkit/append_link.py +++ b/blenderkit/append_link.py @@ -87,6 +87,11 @@ def append_scene(file_name, scenename=None, link=False, fake_user=False): scene.use_fake_user = True # scene has to have a new uuid, so user reports aren't screwed. scene['uuid'] = str(uuid.uuid4()) + + #reset ui_props of the scene to defaults: + ui_props = bpy.context.scene.blenderkitUI + ui_props.down_up = 'SEARCH' + return scene diff --git a/blenderkit/upload.py b/blenderkit/upload.py index 405c11005f12eca7a19c7c3cee439d1d98e4f0aa..49533e99b3023f6aeef6c144f48ccdfb09dd28ce 100644 --- a/blenderkit/upload.py +++ b/blenderkit/upload.py @@ -467,7 +467,7 @@ def get_upload_data(caller=None, context=None, asset_type=None): add_version(upload_data) # caller can be upload operator, but also asset bar called from tooltip generator - if caller and caller.main_file == True: + if caller and caller.properties.main_file == True: upload_data["name"] = props.name upload_data["displayName"] = props.name else: @@ -1069,8 +1069,7 @@ def start_upload(self, context, asset_type, reupload, upload_set): props.id = '' export_data, upload_data = get_upload_data(caller=self, context=context, asset_type=asset_type) - # print(export_data) - # print(upload_data) + # check if thumbnail exists, generate for HDR: if 'THUMBNAIL' in upload_set: if asset_type == 'HDR': @@ -1185,6 +1184,11 @@ class UploadOperator(Operator): if self.main_file: upload_set.append('MAINFILE') + #this is accessed later in get_upload_data and needs to be written. + # should pass upload_set all the way to it probably + if 'MAINFILE' in upload_set: + self.main_file = True + result = start_upload(self, context, self.asset_type, self.reupload, upload_set=upload_set, ) return {'FINISHED'}