Hello,
i have coded a small addon which allows to copy the custom properties from the active object to the selected objects.
Simply install as usually (Install from File) and you should find a new Copy Custom Properties Panel and Button under “Object” Properties.
Its only a simple addon, but i hope it might be useful.
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
bl_info = {
"name": "Copy Custom Properties",
"author": "scorpion81",
"version": ( 1, 0, 0 ),
"blender": ( 2, 6, 9 ),
"location": "Object > Custom Properties Copy > Copy Custom Properties",
"description": "Copies custom properties from active object to selected objects",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Object"
}
def set_prop(ob, name, value):
ob[name] = value
def getProps(ob):
names = list(set(ob.keys()) - set(('cycles_visibility', '_RNA_UI')))
values = [(name, ob[name]) for name in names]
return values
class CopyCustomProperties(bpy.types.Operator):
"""Copy Custom Properties from Active to Selected objects"""
bl_idname = "object.custom_property_copy"
bl_label = "Copy Custom Properties"
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
active = bpy.context.active_object
selected = bpy.context.selected_objects
[[set_prop(ob, name, value) for (name, value) in getProps(active)] for ob in selected]
return {'FINISHED'}
class CopyPanel(bpy.types.Panel):
"""Creates a Custom Property Panel in the Object properties window"""
bl_label = "Custom Property Active to Selected"
bl_idname = "OBJECT_PT_customprop"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
def draw(self, context):
layout = self.layout
layout.operator("object.custom_property_copy")
def register():
bpy.utils.register_class(CopyCustomProperties)
bpy.utils.register_class(CopyPanel)
def unregister():
bpy.utils.unregister_class(CopyPanel)
bpy.utils.unregister_class(CopyCustomProperties)
if __name__ == "__main__":
register()
object_copy_custom_properties.zip (1.28 KB)
Version compatible with Blender 2.8:
object_copy_custom_properties_1_06.zip (2.0 KB)
scorpion81