What brush data is saved?
I am working on Blender C ++ code for my thesis.
When I apply a stroke to an object in the sculpting system, I have to store information about the brushes and their locations. To do this, I save in a file all the Brush data defined in blender / makedna / DNA_brush_types.h, except for these values:
ID id;
struct BrushClone clone;
struct CurveMapping *curve; /* falloff curve */
struct MTex mtex;
struct MTex mask_mtex;
struct Brush *toggle_brush;
struct ImBuf *icon_imbuf;
PreviewImage *preview;
char icon_filepath[1024]; /* 1024 = FILE_MAX */
I store them in the sculpt_stroke_done function /blender/editors/sculpt_paint/sculpt.c
.
For my location, I keep the mouse coordinates in sculpt_stroke_test_start
the same source file.
Then, into a new instance of Blender, I want to reload that information to apply the same stroke to the object, and I want this to happen by clicking everywhere in 3D as well (not just clicking on the object). I am doing this loading of file information in /blender/editors/sculpt_paint/paint_stroke.c
( paint_stroke_new method
). I am doing tests in the original Blender context (sculpting the cube into the original Blender scene), and with strokes defined with a single click (the simplest brush I think). So far, the result is this: when I try to reapply the same brush, I get a cube transform (scale or translation, which I mean). Anyway, it looks like a brush, but the deformation of the sculpture does not match the saved brush. My professor suggested that I find other parameters that I need to keep, but what?
Can anyone help me?
source to share
No one has answered this question yet
Check out similar questions: