Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/gpencil_geom.c
| Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | |||||
| */ | */ | ||||
| BoundBox *BKE_gpencil_boundbox_get(Object *ob) | BoundBox *BKE_gpencil_boundbox_get(Object *ob) | ||||
| { | { | ||||
| if (ELEM(NULL, ob, ob->data)) { | if (ELEM(NULL, ob, ob->data)) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| bGPdata *gpd = (bGPdata *)ob->data; | bGPdata *gpd = (bGPdata *)ob->data; | ||||
| if ((ob->runtime.bb) && ((gpd->flag & GP_DATA_CACHE_IS_DIRTY) == 0)) { | if ((ob->runtime.bb) && ((gpd->flag & GP_DATA_CACHE_IS_DIRTY) == 0)) { | ||||
| return ob->runtime.bb; | return ob->runtime.bb; | ||||
| } | } | ||||
mont29: Move this below together with rest of the new code, no reason to call this function when not… | |||||
| boundbox_gpencil(ob); | boundbox_gpencil(ob); | ||||
| Object *ob_orig = (Object *)DEG_get_original_id(&ob->id); | |||||
| /* Update orig object's boundbox with re-computed evaluated values. This function can be | |||||
| * called with the evaluated object and need update the original object bound box data | |||||
| * to keep both values synchronized. */ | |||||
| if ((ob_orig != NULL) && (ob != ob_orig)) { | |||||
| if (ob_orig->runtime.bb == NULL) { | |||||
| ob_orig->runtime.bb = MEM_callocN(sizeof(BoundBox), "GPencil boundbox"); | |||||
Not Done Inline ActionsBe a bit more explicit in your comments, everyone can see that this is a copy, but why is this copy needed? something like `Update orig object's boundbox with re-computed evaluated values.` or something like that. mont29: Be a bit more explicit in your comments, everyone can see that this is a copy, but why is this… | |||||
| } | |||||
| for (int i = 0; i < 8; i++) { | |||||
| copy_v3_v3(ob_orig->runtime.bb->vec[i], ob->runtime.bb->vec[i]); | |||||
| } | |||||
| } | |||||
| return ob->runtime.bb; | return ob->runtime.bb; | ||||
| } | } | ||||
| /* ************************************************** */ | /* ************************************************** */ | ||||
| static int stroke_march_next_point(const bGPDstroke *gps, | static int stroke_march_next_point(const bGPDstroke *gps, | ||||
| const int index_next_pt, | const int index_next_pt, | ||||
| const float *current, | const float *current, | ||||
| ▲ Show 20 Lines • Show All 2,405 Lines • Show Last 20 Lines | |||||
Move this below together with rest of the new code, no reason to call this function when not needed.