2009-11-01 15:21:20 +00:00
|
|
|
# ##### 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.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# 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.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-04-11 16:17:39 +00:00
|
|
|
import bpy
|
2014-08-06 18:03:16 +00:00
|
|
|
from bpy.types import Panel, Menu
|
2010-01-08 08:54:41 +00:00
|
|
|
from rna_prop_ui import PropertyPanel
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2011-09-20 18:29:19 +00:00
|
|
|
|
2015-01-29 04:35:06 +00:00
|
|
|
class ObjectButtonsPanel:
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "object"
|
2009-04-11 02:18:24 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OBJECT_PT_context_object(ObjectButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
* Multiply for panorama cameras
* Some cases of struct name being set where it shouldnt have been.
* Spelling: wich --> which
* Copy and initialize uv modifier scale, remove unneeded enum.
* Ability to pin any object into the context.
* Update uv window while transforming (useful when used with UVProject modifier)
* Patch by Wahooney, so new template's are internal text and dont get saved over
by mistake.
* Fix for https://bugzilla.redhat.com/show_bug.cgi?id=572186
Bug 572186 - [abrt] crash in blender-2.49b-5.fc12: Process
/usr/bin/blender.bin was killed by signal 6 (SIGABRT). Original fix submitted
by Jochen Schmitt.
* [#21816] bpy.data.add_image has stopped working on Windows. moved to
bpy.data.images.load(), missed this call.
(commits 27726,27825,27828,27831,27832,27833,27834,27836,27837,27838,27839,27858 by Campbell from render25 branch)
2010-03-30 12:15:16 +00:00
|
|
|
space = context.space_data
|
2009-10-31 19:31:45 +00:00
|
|
|
|
* Multiply for panorama cameras
* Some cases of struct name being set where it shouldnt have been.
* Spelling: wich --> which
* Copy and initialize uv modifier scale, remove unneeded enum.
* Ability to pin any object into the context.
* Update uv window while transforming (useful when used with UVProject modifier)
* Patch by Wahooney, so new template's are internal text and dont get saved over
by mistake.
* Fix for https://bugzilla.redhat.com/show_bug.cgi?id=572186
Bug 572186 - [abrt] crash in blender-2.49b-5.fc12: Process
/usr/bin/blender.bin was killed by signal 6 (SIGABRT). Original fix submitted
by Jochen Schmitt.
* [#21816] bpy.data.add_image has stopped working on Windows. moved to
bpy.data.images.load(), missed this call.
(commits 27726,27825,27828,27831,27832,27833,27834,27836,27837,27838,27839,27858 by Campbell from render25 branch)
2010-03-30 12:15:16 +00:00
|
|
|
if space.use_pin_id:
|
2010-12-30 12:22:28 +00:00
|
|
|
layout.template_ID(space, "pin_id")
|
* Multiply for panorama cameras
* Some cases of struct name being set where it shouldnt have been.
* Spelling: wich --> which
* Copy and initialize uv modifier scale, remove unneeded enum.
* Ability to pin any object into the context.
* Update uv window while transforming (useful when used with UVProject modifier)
* Patch by Wahooney, so new template's are internal text and dont get saved over
by mistake.
* Fix for https://bugzilla.redhat.com/show_bug.cgi?id=572186
Bug 572186 - [abrt] crash in blender-2.49b-5.fc12: Process
/usr/bin/blender.bin was killed by signal 6 (SIGABRT). Original fix submitted
by Jochen Schmitt.
* [#21816] bpy.data.add_image has stopped working on Windows. moved to
bpy.data.images.load(), missed this call.
(commits 27726,27825,27828,27831,27832,27833,27834,27836,27837,27838,27839,27858 by Campbell from render25 branch)
2010-03-30 12:15:16 +00:00
|
|
|
else:
|
2010-12-24 10:15:57 +00:00
|
|
|
row = layout.row()
|
2018-01-03 13:09:10 +00:00
|
|
|
row.template_ID(context.view_layer.objects, "active", filter='AVAILABLE')
|
2009-07-09 16:09:44 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Transform"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-05-30 15:47:48 +00:00
|
|
|
layout.use_property_split = True
|
2018-06-10 11:56:23 +00:00
|
|
|
|
2018-07-01 07:23:51 +00:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(ob, "location")
|
2018-06-20 15:01:33 +00:00
|
|
|
row.use_property_decorate = False
|
|
|
|
row.prop(ob, "lock_location", text="", emboss=False)
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
if ob.rotation_mode == 'QUATERNION':
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(ob, "rotation_quaternion", text="Rotation")
|
|
|
|
sub = row.column(align=True)
|
2018-06-20 15:01:33 +00:00
|
|
|
sub.use_property_decorate = False
|
|
|
|
sub.prop(ob, "lock_rotation_w", text="", emboss=False)
|
|
|
|
sub.prop(ob, "lock_rotation", text="", emboss=False)
|
2010-08-06 15:17:44 +00:00
|
|
|
elif ob.rotation_mode == 'AXIS_ANGLE':
|
2018-05-30 15:47:48 +00:00
|
|
|
# row.column().label(text="Rotation")
|
2011-09-21 15:18:38 +00:00
|
|
|
#row.column().prop(pchan, "rotation_angle", text="Angle")
|
|
|
|
#row.column().prop(pchan, "rotation_axis", text="Axis")
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(ob, "rotation_axis_angle", text="Rotation")
|
|
|
|
|
|
|
|
sub = row.column(align=True)
|
2018-06-20 15:01:33 +00:00
|
|
|
sub.use_property_decorate = False
|
|
|
|
sub.prop(ob, "lock_rotation_w", text="", emboss=False)
|
|
|
|
sub.prop(ob, "lock_rotation", text="", emboss=False)
|
2018-06-10 11:56:23 +00:00
|
|
|
else:
|
|
|
|
col = flow.column()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(ob, "rotation_euler", text="Rotation")
|
2018-06-20 15:01:33 +00:00
|
|
|
row.use_property_decorate = False
|
|
|
|
row.prop(ob, "lock_rotation", text="", emboss=False)
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(ob, "scale")
|
2018-06-20 15:01:33 +00:00
|
|
|
row.use_property_decorate = False
|
|
|
|
row.prop(ob, "lock_scale", text="", emboss=False)
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2018-06-20 15:01:33 +00:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(ob, "rotation_mode")
|
2018-06-20 16:21:01 +00:00
|
|
|
row.label(text="", icon='BLANK1')
|
2011-01-01 07:20:34 +00:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Delta Transform"
|
2018-06-04 10:20:40 +00:00
|
|
|
bl_parent_id = "OBJECT_PT_transform"
|
2010-10-16 11:52:30 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-05-30 15:47:48 +00:00
|
|
|
layout.use_property_split = True
|
2018-07-01 07:23:51 +00:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=True, align=False)
|
2010-10-16 11:52:30 +00:00
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(ob, "delta_location")
|
2010-10-16 11:52:30 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
2010-10-16 11:52:30 +00:00
|
|
|
if ob.rotation_mode == 'QUATERNION':
|
2018-06-10 11:56:23 +00:00
|
|
|
col.prop(ob, "delta_rotation_quaternion", text="Rotation")
|
2010-10-16 11:52:30 +00:00
|
|
|
elif ob.rotation_mode == 'AXIS_ANGLE':
|
2018-05-30 15:47:48 +00:00
|
|
|
# row.column().label(text="Rotation")
|
2011-09-21 15:18:38 +00:00
|
|
|
#row.column().prop(pchan, "delta_rotation_angle", text="Angle")
|
|
|
|
#row.column().prop(pchan, "delta_rotation_axis", text="Axis")
|
|
|
|
#row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation")
|
2018-06-10 11:56:23 +00:00
|
|
|
col.label(text="Not for Axis-Angle")
|
2010-10-16 11:52:30 +00:00
|
|
|
else:
|
2018-06-10 11:56:23 +00:00
|
|
|
col.prop(ob, "delta_rotation_euler", text="Delta Rotation")
|
2012-06-19 22:17:19 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(ob, "delta_scale")
|
2009-04-11 02:18:24 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Relations"
|
2018-05-30 15:47:48 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-05-30 15:47:48 +00:00
|
|
|
layout.use_property_split = True
|
2018-07-01 07:23:51 +00:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
2018-05-30 15:47:48 +00:00
|
|
|
col.prop(ob, "parent")
|
2018-06-10 11:56:23 +00:00
|
|
|
sub = col.row(align=True)
|
2018-05-30 15:47:48 +00:00
|
|
|
sub.prop(ob, "parent_type")
|
2009-10-31 19:31:45 +00:00
|
|
|
parent = ob.parent
|
|
|
|
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
|
2018-05-30 15:47:48 +00:00
|
|
|
sub.prop_search(ob, "parent_bone", parent.data, "bones")
|
2009-11-22 17:41:35 +00:00
|
|
|
sub.active = (parent is not None)
|
2009-07-14 20:27:28 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
2018-05-30 15:47:48 +00:00
|
|
|
col.active = (ob.parent is not None)
|
|
|
|
col.prop(ob, "use_slow_parent")
|
2018-06-10 11:56:23 +00:00
|
|
|
sub = col.row(align=True)
|
2018-05-30 15:47:48 +00:00
|
|
|
sub.active = (ob.use_slow_parent)
|
|
|
|
sub.prop(ob, "slow_parent_offset", text="Offset")
|
2014-09-17 08:36:17 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
2018-05-30 15:47:48 +00:00
|
|
|
col.separator()
|
2017-02-16 17:01:07 +00:00
|
|
|
|
2018-05-30 15:47:48 +00:00
|
|
|
col.prop(ob, "track_axis", text="Tracking Axis")
|
2018-04-16 12:07:42 +00:00
|
|
|
col.prop(ob, "up_axis", text="Up Axis")
|
2017-02-16 17:01:07 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
2018-05-30 15:47:48 +00:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.prop(ob, "pass_index")
|
2017-02-16 17:01:07 +00:00
|
|
|
|
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
class COLLECTION_MT_specials(Menu):
|
|
|
|
bl_label = "Collection Specials"
|
2014-08-06 18:03:16 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
layout.operator("object.collection_unlink", icon='X')
|
|
|
|
layout.operator("object.collection_objects_select")
|
2014-08-06 18:36:56 +00:00
|
|
|
layout.operator("object.dupli_offset_from_cursor")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
class OBJECT_PT_collections(ObjectButtonsPanel, Panel):
|
|
|
|
bl_label = "Collections"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-04-11 02:18:24 +00:00
|
|
|
|
2012-07-03 10:32:10 +00:00
|
|
|
obj = context.object
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2010-06-27 21:35:31 +00:00
|
|
|
row = layout.row(align=True)
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
if bpy.data.collections:
|
|
|
|
row.operator("object.collection_link", text="Add to Collection")
|
2013-03-20 01:41:33 +00:00
|
|
|
else:
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
row.operator("object.collection_add", text="Add to Collection")
|
|
|
|
row.operator("object.collection_add", text="", icon='ZOOMIN')
|
2009-04-11 02:18:24 +00:00
|
|
|
|
2012-07-03 10:32:10 +00:00
|
|
|
obj_name = obj.name
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
for collection in bpy.data.collections:
|
2012-07-03 10:32:10 +00:00
|
|
|
# XXX this is slow and stupid!, we need 2 checks, one thats fast
|
2014-01-13 03:53:41 +00:00
|
|
|
# and another that we can be sure its not a name collision
|
2012-07-03 10:32:10 +00:00
|
|
|
# from linked library data
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
collection_objects = collection.objects
|
|
|
|
if obj_name in collection.objects and obj in collection_objects[:]:
|
2009-10-31 19:31:45 +00:00
|
|
|
col = layout.column(align=True)
|
2009-04-11 02:18:24 +00:00
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
col.context_pointer_set("collection", collection)
|
2009-07-14 20:27:28 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
row = col.box().row()
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
row.prop(collection, "name", text="")
|
|
|
|
row.operator("object.collection_remove", text="", icon='X', emboss=False)
|
|
|
|
row.menu("COLLECTION_MT_specials", icon='DOWNARROW_HLT', text="")
|
2009-04-11 02:18:24 +00:00
|
|
|
|
2017-12-01 13:24:21 +00:00
|
|
|
row = col.box().row()
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
row.prop(collection, "dupli_offset", text="")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OBJECT_PT_display(ObjectButtonsPanel, Panel):
|
2018-06-01 14:07:25 +00:00
|
|
|
bl_label = "Viewport Display"
|
2018-05-30 15:47:48 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-05-30 15:47:48 +00:00
|
|
|
layout.use_property_split = True
|
2018-09-03 17:33:23 +00:00
|
|
|
|
2018-07-01 07:23:51 +00:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2013-07-28 22:12:19 +00:00
|
|
|
|
2013-04-03 05:16:15 +00:00
|
|
|
obj = context.object
|
2013-07-28 11:43:11 +00:00
|
|
|
obj_type = obj.type
|
|
|
|
is_geometry = (obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'})
|
2014-05-13 06:52:51 +00:00
|
|
|
is_wire = (obj_type in {'CAMERA', 'EMPTY'})
|
2013-07-28 11:43:11 +00:00
|
|
|
is_empty_image = (obj_type == 'EMPTY' and obj.empty_draw_type == 'IMAGE')
|
2014-03-13 15:13:31 +00:00
|
|
|
is_dupli = (obj.dupli_type != 'NONE')
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2018-09-03 17:33:23 +00:00
|
|
|
col = flow.column()
|
2013-04-03 05:16:15 +00:00
|
|
|
col.prop(obj, "show_name", text="Name")
|
2018-09-03 17:33:23 +00:00
|
|
|
|
|
|
|
col = flow.column()
|
2013-04-03 05:16:15 +00:00
|
|
|
col.prop(obj, "show_axis", text="Axis")
|
2018-06-10 11:56:23 +00:00
|
|
|
|
2014-03-13 15:13:31 +00:00
|
|
|
# Makes no sense for cameras, armatures, etc.!
|
|
|
|
# but these settings do apply to dupli instances
|
|
|
|
if is_geometry or is_dupli:
|
2018-09-03 17:33:23 +00:00
|
|
|
col = flow.column()
|
2018-06-10 11:56:23 +00:00
|
|
|
col.prop(obj, "show_wire", text="Wireframe")
|
2014-03-13 15:13:31 +00:00
|
|
|
if obj_type == 'MESH' or is_dupli:
|
2018-09-03 17:33:23 +00:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(obj, "show_all_edges", text="All Edges")
|
2013-07-28 11:43:11 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
2013-07-28 11:43:11 +00:00
|
|
|
if is_geometry:
|
|
|
|
col.prop(obj, "show_texture_space", text="Texture Space")
|
2018-09-03 17:33:23 +00:00
|
|
|
col = flow.column()
|
2018-05-30 15:47:48 +00:00
|
|
|
col.prop(obj.display, "show_shadows", text="Shadow")
|
2018-05-09 13:13:12 +00:00
|
|
|
|
2018-09-03 17:33:23 +00:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(obj, "show_x_ray", text="In Front")
|
2018-06-10 11:56:23 +00:00
|
|
|
# if obj_type == 'MESH' or is_empty_image:
|
|
|
|
# col.prop(obj, "show_transparent", text="Transparency")
|
2013-07-28 11:43:11 +00:00
|
|
|
|
2018-09-03 17:33:23 +00:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
2014-05-13 06:52:51 +00:00
|
|
|
if is_wire:
|
|
|
|
# wire objects only use the max. draw type for duplis
|
|
|
|
col.active = is_dupli
|
2018-09-03 17:33:23 +00:00
|
|
|
col.prop(obj, "draw_type", text="Display As")
|
|
|
|
|
|
|
|
split = flow.split(factor=0.6)
|
|
|
|
split.prop(obj, "show_bounds", text="Bounds")
|
|
|
|
row = split.row()
|
|
|
|
row.active = obj.show_bounds or (obj.draw_type == 'BOUNDS')
|
|
|
|
row.prop(obj, "draw_bounds_type", text="")
|
|
|
|
|
2013-07-28 11:43:11 +00:00
|
|
|
if is_geometry or is_empty_image:
|
|
|
|
# Only useful with object having faces/materials...
|
2018-09-03 17:33:23 +00:00
|
|
|
col = flow.column()
|
2018-05-30 15:47:48 +00:00
|
|
|
col.prop(obj, "color")
|
2009-04-11 02:18:24 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Duplication"
|
2018-05-30 15:47:48 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(ob, "dupli_type", expand=True)
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2018-05-30 15:47:48 +00:00
|
|
|
layout.use_property_split = True
|
2018-07-01 07:23:51 +00:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2018-05-30 15:47:48 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if ob.dupli_type == 'FRAMES':
|
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(ob, "dupli_frames_start", text="Start")
|
|
|
|
col.prop(ob, "dupli_frames_end", text="End")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(ob, "dupli_frames_on", text="On")
|
|
|
|
col.prop(ob, "dupli_frames_off", text="Off")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column(align=True)
|
|
|
|
col.prop(ob, "use_dupli_frames_speed", text="Speed")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
elif ob.dupli_type == 'VERTS':
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
elif ob.dupli_type == 'FACES':
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
2018-05-30 15:47:48 +00:00
|
|
|
col.prop(ob, "use_dupli_faces_scale", text="Scale")
|
|
|
|
sub = col.column()
|
2013-12-23 15:27:43 +00:00
|
|
|
sub.active = ob.use_dupli_faces_scale
|
|
|
|
sub.prop(ob, "dupli_faces_scale", text="Inherit Scale")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
elif ob.dupli_type == 'COLLECTION':
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(ob, "dupli_group", text="Collection")
|
2010-08-06 15:17:44 +00:00
|
|
|
|
2018-06-01 14:07:25 +00:00
|
|
|
if ob.dupli_type != 'NONE' or len(ob.particle_systems):
|
2018-06-10 11:56:23 +00:00
|
|
|
col = flow.column(align=True)
|
2018-06-01 14:07:25 +00:00
|
|
|
col.prop(ob, "show_duplicator_for_viewport")
|
|
|
|
col.prop(ob, "show_duplicator_for_render")
|
|
|
|
|
2009-04-11 02:18:24 +00:00
|
|
|
|
2017-10-21 01:41:42 +00:00
|
|
|
from .properties_animviz import (
|
|
|
|
MotionPathButtonsPanel,
|
|
|
|
OnionSkinButtonsPanel,
|
|
|
|
)
|
2010-08-02 02:55:12 +00:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
|
2010-08-02 02:55:12 +00:00
|
|
|
#bl_label = "Object Motion Paths"
|
|
|
|
bl_context = "object"
|
2018-08-02 02:44:17 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2010-08-02 02:55:12 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-08-02 02:55:12 +00:00
|
|
|
return (context.object)
|
2010-03-06 01:40:29 +00:00
|
|
|
|
2010-08-02 02:55:12 +00:00
|
|
|
def draw(self, context):
|
2014-04-24 19:31:20 +00:00
|
|
|
# layout = self.layout
|
2010-08-02 02:55:12 +00:00
|
|
|
|
|
|
|
ob = context.object
|
2012-07-03 19:09:07 +00:00
|
|
|
avs = ob.animation_visualization
|
2012-05-01 16:19:13 +00:00
|
|
|
mpath = ob.motion_path
|
2012-05-15 18:50:51 +00:00
|
|
|
|
2012-05-01 16:19:13 +00:00
|
|
|
self.draw_settings(context, avs, mpath)
|
2010-08-02 02:55:12 +00:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from panel when ready
|
2010-08-02 02:55:12 +00:00
|
|
|
#bl_label = "Object Onion Skinning"
|
|
|
|
bl_context = "object"
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-08-02 02:55:12 +00:00
|
|
|
return (context.object)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
ob = context.object
|
|
|
|
|
2012-07-03 19:09:07 +00:00
|
|
|
self.draw_settings(context, ob.animation_visualization)
|
2010-08-02 02:55:12 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel):
|
2018-07-11 09:43:56 +00:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
|
2010-08-02 02:55:12 +00:00
|
|
|
_context_path = "object"
|
2010-12-17 10:33:28 +00:00
|
|
|
_property_type = bpy.types.Object
|
2011-04-04 10:13:04 +00:00
|
|
|
|
2017-03-18 09:03:24 +00:00
|
|
|
|
|
|
|
classes = (
|
|
|
|
OBJECT_PT_context_object,
|
2017-03-19 15:34:32 +00:00
|
|
|
OBJECT_PT_transform,
|
2017-03-18 09:03:24 +00:00
|
|
|
OBJECT_PT_delta_transform,
|
2017-03-19 15:34:32 +00:00
|
|
|
OBJECT_PT_relations,
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 13:57:22 +00:00
|
|
|
COLLECTION_MT_specials,
|
|
|
|
OBJECT_PT_collections,
|
2017-03-18 09:03:24 +00:00
|
|
|
OBJECT_PT_duplication,
|
2018-06-10 11:56:23 +00:00
|
|
|
OBJECT_PT_display,
|
2017-03-18 09:03:24 +00:00
|
|
|
OBJECT_PT_motion_paths,
|
2017-03-19 15:34:32 +00:00
|
|
|
OBJECT_PT_custom_props,
|
2017-03-18 09:03:24 +00:00
|
|
|
)
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 09:03:24 +00:00
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|