Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_add.cc
| Show First 20 Lines • Show All 2,091 Lines • ▼ Show 20 Lines | static int object_curves_empty_hair_add_exec(bContext *C, wmOperator *op) | ||||
| curves_id->surface = surface_ob; | curves_id->surface = surface_ob; | ||||
| /* Parent to surface object. */ | /* Parent to surface object. */ | ||||
| ED_object_parent_set( | ED_object_parent_set( | ||||
| op->reports, C, scene, curves_ob, surface_ob, PAR_OBJECT, false, true, nullptr); | op->reports, C, scene, curves_ob, surface_ob, PAR_OBJECT, false, true, nullptr); | ||||
| /* Decide which UV map to use for attachment. */ | /* Decide which UV map to use for attachment. */ | ||||
| Mesh *surface_mesh = static_cast<Mesh *>(surface_ob->data); | Mesh *surface_mesh = static_cast<Mesh *>(surface_ob->data); | ||||
| const char *uv_name = CustomData_get_active_layer_name(&surface_mesh->ldata, CD_MLOOPUV); | const char *uv_name = CustomData_get_active_layer_name(&surface_mesh->ldata, CD_PROP_FLOAT2); | ||||
| if (uv_name != nullptr) { | if (uv_name != nullptr) { | ||||
| curves_id->surface_uv_map = BLI_strdup(uv_name); | curves_id->surface_uv_map = BLI_strdup(uv_name); | ||||
| } | } | ||||
| /* Add deformation modifier. */ | /* Add deformation modifier. */ | ||||
| blender::ed::curves::ensure_surface_deformation_node_exists(*C, *curves_ob); | blender::ed::curves::ensure_surface_deformation_node_exists(*C, *curves_ob); | ||||
| /* Make sure the surface object has a rest position attribute which is necessary for | /* Make sure the surface object has a rest position attribute which is necessary for | ||||
| ▲ Show 20 Lines • Show All 2,160 Lines • Show Last 20 Lines | |||||