Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_nodes.cc
| Show First 20 Lines • Show All 578 Lines • ▼ Show 20 Lines | case SOCK_COLLECTION: { | ||||
| ID *id = IDP_Id(&property); | ID *id = IDP_Id(&property); | ||||
| Collection *collection = (id && GS(id->name) == ID_GR) ? (Collection *)id : nullptr; | Collection *collection = (id && GS(id->name) == ID_GR) ? (Collection *)id : nullptr; | ||||
| *(Collection **)r_value = collection; | *(Collection **)r_value = collection; | ||||
| }, | }, | ||||
| }; | }; | ||||
| return &collection_type; | return &collection_type; | ||||
| } | } | ||||
| case SOCK_TEXTURE: { | case SOCK_TEXTURE: { | ||||
| static const SocketPropertyType collection_type = { | static const SocketPropertyType texture_type = { | ||||
| [](const bNodeSocket &socket, const char *name) { | [](const bNodeSocket &socket, const char *name) { | ||||
| bNodeSocketValueTexture *value = (bNodeSocketValueTexture *)socket.default_value; | bNodeSocketValueTexture *value = (bNodeSocketValueTexture *)socket.default_value; | ||||
| IDPropertyTemplate idprop = {0}; | IDPropertyTemplate idprop = {0}; | ||||
| idprop.id = (ID *)value->value; | idprop.id = (ID *)value->value; | ||||
| return IDP_New(IDP_ID, &idprop, name); | return IDP_New(IDP_ID, &idprop, name); | ||||
| }, | }, | ||||
| nullptr, | nullptr, | ||||
| nullptr, | nullptr, | ||||
| nullptr, | nullptr, | ||||
| nullptr, | nullptr, | ||||
| [](const IDProperty &property) { return property.type == IDP_ID; }, | [](const IDProperty &property) { return property.type == IDP_ID; }, | ||||
| [](const IDProperty &property, void *r_value) { | [](const IDProperty &property, void *r_value) { | ||||
| ID *id = IDP_Id(&property); | ID *id = IDP_Id(&property); | ||||
| Tex *texture = (id && GS(id->name) == ID_TE) ? (Tex *)id : nullptr; | Tex *texture = (id && GS(id->name) == ID_TE) ? (Tex *)id : nullptr; | ||||
| *(Tex **)r_value = texture; | *(Tex **)r_value = texture; | ||||
| }, | }, | ||||
| }; | }; | ||||
| return &collection_type; | return &texture_type; | ||||
| } | } | ||||
| case SOCK_MATERIAL: { | case SOCK_MATERIAL: { | ||||
| static const SocketPropertyType collection_type = { | static const SocketPropertyType material_type = { | ||||
| [](const bNodeSocket &socket, const char *name) { | [](const bNodeSocket &socket, const char *name) { | ||||
| bNodeSocketValueMaterial *value = (bNodeSocketValueMaterial *)socket.default_value; | bNodeSocketValueMaterial *value = (bNodeSocketValueMaterial *)socket.default_value; | ||||
| IDPropertyTemplate idprop = {0}; | IDPropertyTemplate idprop = {0}; | ||||
| idprop.id = (ID *)value->value; | idprop.id = (ID *)value->value; | ||||
| return IDP_New(IDP_ID, &idprop, name); | return IDP_New(IDP_ID, &idprop, name); | ||||
| }, | }, | ||||
| nullptr, | nullptr, | ||||
| nullptr, | nullptr, | ||||
| nullptr, | nullptr, | ||||
| nullptr, | nullptr, | ||||
| [](const IDProperty &property) { return property.type == IDP_ID; }, | [](const IDProperty &property) { return property.type == IDP_ID; }, | ||||
| [](const IDProperty &property, void *r_value) { | [](const IDProperty &property, void *r_value) { | ||||
| ID *id = IDP_Id(&property); | ID *id = IDP_Id(&property); | ||||
| Material *material = (id && GS(id->name) == ID_MA) ? (Material *)id : nullptr; | Material *material = (id && GS(id->name) == ID_MA) ? (Material *)id : nullptr; | ||||
| *(Material **)r_value = material; | *(Material **)r_value = material; | ||||
| }, | }, | ||||
| }; | }; | ||||
| return &collection_type; | return &material_type; | ||||
| } | } | ||||
| default: { | default: { | ||||
| return nullptr; | return nullptr; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 656 Lines • Show Last 20 Lines | |||||