Objects: add Volume object type, and prototypes for Hair and PointCloud

Only the volume object is exposed in the user interface. It is based on OpenVDB
internally. Drawing and rendering code will follow in another commit.
https://wiki.blender.org/wiki/Source/Objects/Volume
https://wiki.blender.org/wiki/Reference/Release_Notes/2.83/Volumes

Hair and PointCloud object types are hidden behind a WITH_NEW_OBJECT_TYPES
build option. These are unfinished, and included only to make it easier to
cooperate on development in the future and avoid tricky merges.
https://wiki.blender.org/wiki/Source/Objects/New_Object_Types

Ref T73201, T68981

Differential Revision: https://developer.blender.org/D6945
This commit is contained in:
2020-03-17 14:41:48 +01:00
parent 8dcfd392e4
commit b0a1cf2c9a
118 changed files with 7093 additions and 156 deletions

View File

@@ -30,6 +30,7 @@
#include "DNA_collection_types.h"
#include "DNA_constraint_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_hair_types.h"
#include "DNA_key_types.h"
#include "DNA_light_types.h"
#include "DNA_lattice_types.h"
@@ -43,6 +44,7 @@
#include "DNA_object_force_types.h"
#include "DNA_outliner_types.h"
#include "DNA_lightprobe_types.h"
#include "DNA_pointcloud_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
@@ -52,6 +54,7 @@
#include "DNA_sound_types.h"
#include "DNA_text_types.h"
#include "DNA_vfont_types.h"
#include "DNA_volume_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_workspace_types.h"
#include "DNA_world_types.h"
@@ -1250,6 +1253,27 @@ static void library_foreach_ID_link(Main *bmain,
break;
}
case ID_HA: {
Hair *hair = (Hair *)id;
for (i = 0; i < hair->totcol; i++) {
CALLBACK_INVOKE(hair->mat[i], IDWALK_CB_USER);
}
break;
}
case ID_PT: {
PointCloud *pointcloud = (PointCloud *)id;
for (i = 0; i < pointcloud->totcol; i++) {
CALLBACK_INVOKE(pointcloud->mat[i], IDWALK_CB_USER);
}
break;
}
case ID_VO: {
Volume *volume = (Volume *)id;
for (i = 0; i < volume->totcol; i++) {
CALLBACK_INVOKE(volume->mat[i], IDWALK_CB_USER);
}
break;
}
case ID_SCR: {
if (data.flag & IDWALK_INCLUDE_UI) {
@@ -1416,6 +1440,12 @@ bool BKE_library_id_can_use_idtype(ID *id_owner, const short id_type_used)
return ELEM(id_type_used, ID_MA);
case ID_WS:
return ELEM(id_type_used, ID_SCR, ID_SCE);
case ID_HA:
return ELEM(id_type_used, ID_MA);
case ID_PT:
return ELEM(id_type_used, ID_MA);
case ID_VO:
return ELEM(id_type_used, ID_MA);
case ID_IM:
case ID_VF:
case ID_TXT: