From bf01cea7274d9ac8ae13fd447c8568c95da31614 Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Tue, 25 Oct 2022 23:47:17 -0400 Subject: graph development --- createcalls.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'createcalls.cpp') diff --git a/createcalls.cpp b/createcalls.cpp index c2122c2..d0ca03e 100644 --- a/createcalls.cpp +++ b/createcalls.cpp @@ -65,6 +65,27 @@ Property_GetInfo(memory *Memory, property_channel *Property) return PropertyInfo; } +static graph_info +Graph_GetInfo(project_data *File, memory *Memory) +{ + graph_info GraphInfo = {}; + for (int a = 0; a < File->Layer_Count; a++) { + block_layer *Layer = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, a); + if (!Layer->IsSelected) + continue; + for (int h = 0; h < AmountOf(Layer->Property); h++) { + property_channel *Property = &Layer->Property[h]; + if (Property->Keyframe_Count) { + property_info PropertyInfo = Property_GetInfo(Memory, Property); + GraphInfo.MinVal = (PropertyInfo.MinVal < GraphInfo.MinVal) ? PropertyInfo.MinVal : GraphInfo.MinVal; + GraphInfo.MaxVal = (PropertyInfo.MaxVal > GraphInfo.MaxVal) ? PropertyInfo.MaxVal : GraphInfo.MaxVal; + } + } + GraphInfo.LowestOffset = (Layer->Vertical_Offset > GraphInfo.LowestOffset) ? Layer->Vertical_Offset : GraphInfo.LowestOffset; + } + return GraphInfo; +} + static void Layer_Interact_Evaluate(memory *Memory, project_state *State, uint16 Layer_Index_Physical, sorted_comp_info SortedCompInfo, sorted_layer *SortedLayerInfo, int32 *Frame_Start, int32 *Frame_End, real32 *Vertical_Offset) -- cgit v1.2.3