Initial Grease Pencil 3.0 stage #106848
|
@ -320,7 +320,14 @@ void legacy_gpencil_to_grease_pencil(Main &main, GreasePencil &grease_pencil, bG
|
|||
|
||||
|
||||
class GreasePencilRuntime {
|
||||
public:
|
||||
/**
|
||||
filedescriptor marked this conversation as resolved
Outdated
Bastien Montagne
commented
Same remark as above about commented out code. Same remark as above about commented out code.
|
||||
* Allocated and freed by the drawing code. See `DRW_grease_pencil_batch_cache_*` functions.
|
||||
*/
|
||||
void *batch_cache = nullptr;
|
||||
Hans Goudey
commented
These two functions should never have to be called outside of the These two functions should never have to be called outside of the `ID` callbacks in `grease_pencil.cc`; IMO they make more sense as static functions there. Probably better to keep that storage for DNA thing as localized as possible.
|
||||
|
||||
public:
|
||||
GreasePencilRuntime() {}
|
||||
~GreasePencilRuntime() {}
|
||||
};
|
||||
Hans Goudey
commented
Member variables come before functions https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Class_Layout Member variables come before functions https://wiki.blender.org/wiki/Style_Guide/C_Cpp#Class_Layout
|
||||
|
||||
} // namespace blender::bke
|
||||
|
|
|
@ -109,11 +109,8 @@ static void grease_pencil_copy_data(Main * /*bmain*/,
|
|||
grease_pencil_src->active_layer->wrap().name());
|
||||
}
|
||||
|
||||
/* Duplicate runtime data. */
|
||||
if (grease_pencil_src->runtime) {
|
||||
grease_pencil_dst->runtime = MEM_new<bke::GreasePencilRuntime>(__func__,
|
||||
*grease_pencil_src->runtime);
|
||||
}
|
||||
/* Make sure the runtime pointer exists. */
|
||||
grease_pencil_dst->runtime = MEM_new<bke::GreasePencilRuntime>(__func__);
|
||||
}
|
||||
filedescriptor marked this conversation as resolved
Outdated
Bastien Montagne
commented
This cannot be 'just' copied like that, would assign the same In general runtime data should not need to be copied anyway. This cannot be 'just' copied like that, would assign the same `batch_cache` value to both copies e.g.
In general runtime data should not need to be copied anyway.
|
||||
|
||||
static void grease_pencil_free_data(ID *id)
|
||||
|
|
Loading…
Reference in New Issue
Put out of line.