Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_gpencil.c
| Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Lines | else { | ||||
| return PROP_EDITABLE; | return PROP_EDITABLE; | ||||
| } | } | ||||
| } | } | ||||
| /* set parent */ | /* set parent */ | ||||
| static void set_parent(bGPDlayer *gpl, Object *par, const int type, const char *substr) | static void set_parent(bGPDlayer *gpl, Object *par, const int type, const char *substr) | ||||
| { | { | ||||
| if (type == PAROBJECT) { | if (type == PAROBJECT) { | ||||
| invert_m4_m4(gpl->inverse, par->obmat); | invert_m4_m4(gpl->inverse, par->object_to_world); | ||||
| gpl->parent = par; | gpl->parent = par; | ||||
| gpl->partype |= PAROBJECT; | gpl->partype |= PAROBJECT; | ||||
| gpl->parsubstr[0] = 0; | gpl->parsubstr[0] = 0; | ||||
| } | } | ||||
| else if (type == PARSKEL) { | else if (type == PARSKEL) { | ||||
| invert_m4_m4(gpl->inverse, par->obmat); | invert_m4_m4(gpl->inverse, par->object_to_world); | ||||
| gpl->parent = par; | gpl->parent = par; | ||||
| gpl->partype |= PARSKEL; | gpl->partype |= PARSKEL; | ||||
| gpl->parsubstr[0] = 0; | gpl->parsubstr[0] = 0; | ||||
| } | } | ||||
| else if (type == PARBONE) { | else if (type == PARBONE) { | ||||
| bPoseChannel *pchan = BKE_pose_channel_find_name(par->pose, substr); | bPoseChannel *pchan = BKE_pose_channel_find_name(par->pose, substr); | ||||
| if (pchan) { | if (pchan) { | ||||
| float tmp_mat[4][4]; | float tmp_mat[4][4]; | ||||
| mul_m4_m4m4(tmp_mat, par->obmat, pchan->pose_mat); | mul_m4_m4m4(tmp_mat, par->object_to_world, pchan->pose_mat); | ||||
| invert_m4_m4(gpl->inverse, tmp_mat); | invert_m4_m4(gpl->inverse, tmp_mat); | ||||
| gpl->parent = par; | gpl->parent = par; | ||||
| gpl->partype |= PARBONE; | gpl->partype |= PARBONE; | ||||
| BLI_strncpy(gpl->parsubstr, substr, sizeof(gpl->parsubstr)); | BLI_strncpy(gpl->parsubstr, substr, sizeof(gpl->parsubstr)); | ||||
| } | } | ||||
| else { | else { | ||||
| invert_m4_m4(gpl->inverse, par->obmat); | invert_m4_m4(gpl->inverse, par->object_to_world); | ||||
| gpl->parent = par; | gpl->parent = par; | ||||
| gpl->partype |= PAROBJECT; | gpl->partype |= PAROBJECT; | ||||
| gpl->parsubstr[0] = 0; | gpl->parsubstr[0] = 0; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* set parent object and inverse matrix */ | /* set parent object and inverse matrix */ | ||||
| ▲ Show 20 Lines • Show All 2,369 Lines • Show Last 20 Lines | |||||