While painting or sculpting, user draws strokes. Is there a way with python to save those (with brush parameters and pressure data) and then play them back slowly also with python?

Point is to produce something like the greasepencil's strokes. These strokes save pressure and, through the layer system, the colour. That stroke can later be edited (changing the color, etc...) and animated. Is there something similar for painting/sculpting? It would allow to show a sculpting process from cube to final sculpt with custom point of view, materials, speed all of that rendered.

Here is the doc about how to sculpt a stroke : http://www.blender.org/documentation/blender_python_api_2_69_10/bpy.ops.sculpt.html. It has a Stroke parameter to be given, but how can I save such a stroke from user input?

  • $\begingroup$ Sounds like you are going to record the complete macro, I don't think we currently got easy solution on this, which doesn't mean anything in most cases. Record screen by Alt F3 if it can be considered as a compromise to that. $\endgroup$ – Leon Cheung Mar 8 '14 at 4:19
  • $\begingroup$ The point is to be able to play that back in the 3D animation. I know dynamicpaint, but it can't reproduce pressure effects, random rotations or jitter at least not as easy and precisely as if recorded from user input with a tablet. $\endgroup$ – matali Mar 8 '14 at 7:42
  • $\begingroup$ If the purpose is to show how you sculpt, wouldn't it be ok to record the screen? Do you basically need an addon to show the pressure amount on screen? $\endgroup$ – CodeManX Mar 11 '14 at 14:20
  • $\begingroup$ The point is to animate the sculpture. A video rendered with cycles would show the cube first, slowly being sculpted as the time goes. For that, I would like to save the strokes with the used parameters to play the sculpting process back at desired speed, all of that rendered. It could also allow to redo the exact same sculpt but with another brush to compare. Recording the screen doesn't allow to have a nice POV and can't be rendered. $\endgroup$ – matali Mar 12 '14 at 14:33
  • $\begingroup$ here there is some doc, but unfinished and I can't get how to save that stroke they speak of blender.org/documentation/blender_python_api_2_69_10/…. There is a stroke parameter to be given, but they don't say how such a stroke can be saved to be reused. $\endgroup$ – matali Mar 12 '14 at 14:36

What you would be trying to record really would be the effect of the movements (sculpting) rather than the actions themselves. Because, the actions themselves have context. The movements of a pen or mouse device make sense only when in "Edit" or "Sculpt" mode.

Now, theoretically, you could respond to a set of events from the user interface and keyframe the effects of those actions to be able to "record" and "play back". But the amount of information and frequency required to do this probably would make the whole thing unusable but for small scale projects. (And in any case, you would still be key-framing the changes applied to the object by the actions, rather than the actions themselves).

But, if we are talking about keyframing mesh modifications, then Blender does already have something that could be of help in this case. It is called "Shape Keys".

Shape keys store intermediate states of a model's mesh and also allow for interpolation between these intermediate states.

The workflow to achieve this "recording" might seem a bit awkward but would consist of mainly two steps: 1) Add a shape key 2) Apply the sculpting "brush stroke".

In the end, you will have a set of shape keys that show the progressive deformation of the mesh, potentially, brush stroke by brush stroke.

You can now key frame the transitions between shape keys to affect the dynamics of the deformations and create an animation that is as fast or as slow as you like.

This would look more like morphing, of course, rather than sculpting, except in the case where you could subdivide one stroke to many different stages.

One thing that could be done to improve the presentation of the effect would be to have the mesh rotating in front of a static camera and apply the transitions when the affected side of the mesh goes off the view. It would give the apperance of more details added with each revolution without the viewer actually seeing the deformations take place.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.