Blender  V3.3
Classes | Functions | Variables
gpencil_bake_animation.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "DNA_anim_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_material_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "BKE_anim_data.h"
#include "BKE_context.h"
#include "BKE_duplilist.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "ED_gpencil.h"
#include "ED_transform_snap_object_context.h"
#include "gpencil_intern.h"

Go to the source code of this file.

Classes

struct  GpBakeOb
 

Functions

static void gpencil_bake_set_frame_end (struct Main *UNUSED(main), struct Scene *UNUSED(scene), struct PointerRNA *ptr)
 
static bool gpencil_bake_grease_pencil_animation_poll (bContext *C)
 
static void animdata_keyframe_list_get (ListBase *ob_list, const bool only_selected, GHash *r_keyframes)
 
static void gpencil_bake_duplilist (Depsgraph *depsgraph, Scene *scene, Object *ob, ListBase *list)
 
static void gpencil_bake_ob_list (bContext *C, Depsgraph *depsgraph, Scene *scene, ListBase *list)
 
static void gpencil_bake_free_ob_list (ListBase *list)
 
static int gpencil_bake_grease_pencil_animation_exec (bContext *C, wmOperator *op)
 
static int gpencil_bake_grease_pencil_animation_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void GPENCIL_OT_bake_grease_pencil_animation (wmOperatorType *ot)
 

Variables

const EnumPropertyItem rna_gpencil_reproject_type_items []
 

Function Documentation

◆ animdata_keyframe_list_get()

static void animdata_keyframe_list_get ( ListBase ob_list,
const bool  only_selected,
GHash r_keyframes 
)
static

◆ gpencil_bake_duplilist()

static void gpencil_bake_duplilist ( Depsgraph depsgraph,
Scene scene,
Object ob,
ListBase list 
)
static

◆ gpencil_bake_free_ob_list()

static void gpencil_bake_free_ob_list ( ListBase list)
static

◆ gpencil_bake_grease_pencil_animation_exec()

static int gpencil_bake_grease_pencil_animation_exec ( bContext C,
wmOperator op 
)
static

Definition at line 194 of file gpencil_bake_animation.cc.

References animdata_keyframe_list_get(), BKE_gpencil_frame_duplicate(), BKE_gpencil_layer_addnew(), BKE_gpencil_layer_frame_get(), BKE_gpencil_layer_named_get(), BKE_gpencil_object_material_index_get(), BKE_gpencil_stroke_geometry_update(), BKE_gpencil_time_modifier_cfra(), BKE_MAT_ASSIGN_USERPREF, BKE_object_material_assign(), BKE_object_material_get(), BKE_object_material_slot_add(), BKE_scene_graph_update_for_newframe(), BLI_addtail(), BLI_ghash_free(), BLI_ghash_haskey(), BLI_ghash_int_new(), BLI_sprintfN(), C, RenderData::cfra, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_view3d(), Scene::cursor, Object::data, DEG_get_ctime(), DEG_get_evaluated_object(), DEG_id_tag_update(), DEG_relations_tag_update(), depsgraph, bGPdata::draw_mode, ED_gpencil_add_object(), ED_gpencil_stroke_reproject(), ED_transform_snap_object_context_create(), ED_transform_snap_object_context_destroy(), RenderData::efra, bGPDframe::flag, bGPDframe::framenum, bGPDlayer::frames, GP_DRAWMODE_2D, GP_FRAME_SELECT, GP_GETFRAME_USE_PREV, GP_REPROJECT_KEEP, gpencil_bake_free_ob_list(), gpencil_bake_ob_list(), gpencil_point_conversion_init(), bGPdata::id, Scene::id, ID_RECALC_COPY_ON_WRITE, ID_RECALC_SELECT, bGPDspoint_Runtime::idx_orig, invert_m4_m4(), bGPdata::layers, LISTBASE_FOREACH, View3D::local_view_uuid, View3D::localvd, View3DCursor::location, MEM_freeN, mul_m4_v3(), NA_ADDED, NC_OBJECT, NC_SCENE, ND_OB_ACTIVE, NULL, GP_SpaceConversion::ob, Object::obmat, OPERATOR_FINISHED, POINTER_FROM_INT, bGPDspoint_Runtime::pt_orig, wmOperator::ptr, Scene::r, RNA_boolean_get(), RNA_enum_get(), RNA_int_get(), bGPDspoint::runtime, scene, RenderData::sfra, bGPDframe::strokes, Object::totcol, WM_cursor_wait(), WM_event_add_notifier(), and bGPDspoint::x.

Referenced by GPENCIL_OT_bake_grease_pencil_animation().

◆ gpencil_bake_grease_pencil_animation_invoke()

static int gpencil_bake_grease_pencil_animation_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ gpencil_bake_grease_pencil_animation_poll()

static bool gpencil_bake_grease_pencil_animation_poll ( bContext C)
static

◆ gpencil_bake_ob_list()

static void gpencil_bake_ob_list ( bContext C,
Depsgraph depsgraph,
Scene scene,
ListBase list 
)
static

◆ gpencil_bake_set_frame_end()

static void gpencil_bake_set_frame_end ( struct Main UNUSEDmain,
struct Scene UNUSEDscene,
struct PointerRNA ptr 
)
static

Definition at line 68 of file gpencil_bake_animation.cc.

References ptr, RNA_int_get(), and RNA_int_set().

Referenced by GPENCIL_OT_bake_grease_pencil_animation().

◆ GPENCIL_OT_bake_grease_pencil_animation()

void GPENCIL_OT_bake_grease_pencil_animation ( wmOperatorType ot)

Variable Documentation

◆ rna_gpencil_reproject_type_items

const EnumPropertyItem rna_gpencil_reproject_type_items[]
Initial value:
= {
{GP_REPROJECT_KEEP, "KEEP", 0, "No Reproject", ""},
{GP_REPROJECT_FRONT, "FRONT", 0, "Front", "Reproject the strokes using the X-Z plane"},
{GP_REPROJECT_SIDE, "SIDE", 0, "Side", "Reproject the strokes using the Y-Z plane"},
{GP_REPROJECT_TOP, "TOP", 0, "Top", "Reproject the strokes using the X-Y plane"},
"VIEW",
0,
"View",
"Reproject the strokes to end up on the same plane, as if drawn from the current "
"viewpoint "
"using 'Cursor' Stroke Placement"},
"CURSOR",
0,
"Cursor",
"Reproject the strokes using the orientation of 3D cursor"},
{0, nullptr, 0, nullptr, nullptr},
}
@ GP_REPROJECT_VIEW
Definition: ED_gpencil.h:58
@ GP_REPROJECT_CURSOR
Definition: ED_gpencil.h:62
@ GP_REPROJECT_KEEP
Definition: ED_gpencil.h:64
@ GP_REPROJECT_SIDE
Definition: ED_gpencil.h:55
@ GP_REPROJECT_TOP
Definition: ED_gpencil.h:56
@ GP_REPROJECT_FRONT
Definition: ED_gpencil.h:54

Definition at line 47 of file gpencil_bake_animation.cc.

Referenced by GPENCIL_OT_bake_grease_pencil_animation(), and GPENCIL_OT_bake_mesh_animation().