Running a paint script across the same object in a series of stills

Apologies if some of what I’m asking here should be obvious – this is my first week of working with Silhouette, and I’m attempting to use it for the project of the moment largely in an attempt to learn the ropes.

I have several still images with the same object in them, in which I’m going to want to be able to apply the same paint operations (after figuring out where the object is located in a given still) in every instance.

While Silhouette is primary built as a video-centric tool, it seems like a good fit for this task – if I can get a reasonably streamlined workflow together for getting the layer with the paint operations aligned with each instance of the object (which requires at least translation and rotation).

Any hints on where to start? If all I had to do was create three tracking points and manually align them to the same points on each image, I’d be thrilled. (If there were automating tooling to take advantage of the object’s very-well-defined edges, that would be even better – magnetic freehand does a beautiful job of finding its outline; where I’m getting a big stuck is getting a preexisting layer with paint on it aligned after a new input is connected).

Welcome @charles

It is not possible to change the position and rotation of previously painted strokes in Paint. I would suggest manually transforming the painted output. Depending on whether you are using the standalone version of Silhouette or the Silhouette Paint plug-in will determine your workflow.

Silhouette Standalone

  • Connect the Paint node’s Paint Only output into a Transform node
    This Paint Only output generates a RGBA result.
  • Manually transform the painted area’s position and rotation to match your object.
  • Composite the result.

Silhouette Paint Plug-in

  • In the host application, set the Output Alpha to Brush Mask.
    This generates an RGBA result.
  • Manually transform the painted area’s position and rotation to match your object.
  • Composite the result.

@marco – thank you! That’s a clever solution, and I’ll keep it in mind should I have a slightly different use case in the future.

That said, in the present case, I painted on the object using clone and drag tools in a way intended to do the right thing across different lighting scenarios; so I really do need the paint strokes to be replayed against each input image.

What I’ve been doing as a manual workflow (in the standalone version of Silhouette) is:

One-time operations:

  • Set up a chain: input image → roto → paint → …other nodes that aren’t important here… → output
  • Create a layer and a roto object for the object in question.
  • In paint, set the “Transform” to that layer.
  • Actually do my painting

For each image:

  • Connect the next input image to the beginning of the chain
  • In the Roto node, manually reposition the layer so the object’s roto shape overlays the object in the image. This is what I’d like to better automate.
  • In the paint node, click “Rebuild”.
  • In the output node, change the filename and click “Render”.

…so, what I was hoping to make easier (not necessarily automated per se, but quick to do with consistency, accuracy and precision) is the repositioning of the layer which the paint has set as its “transform” target. The object (a prop on which some blemishes that stand out in studio lighting are being repaired) has several corners that are easy to identify from any angle; being able to manually align tracking pixels with those corners in the roto node individually (instead of trying to move the whole layer, and thus having a fix to one tracking pixel’s position bring the others out of alignment) and letting the layer be repositioned based on those pixels would be easier than fighting to get the translation+scale+rotation right when controlling them for the layer as a whole.

(I notice that there’s a script editor, but haven’t seen any documentation; that said, my day job is in software and I have a few decades of Python under my belt, so if this is something where a bit of scripting might be useful – say, to automate modification of the output node’s target filenames and take some steps out there – I’d love to be pointed to API docs)

The Roto node has a Multi-Frame mode (M) which allows you to simultaneously move a shape across all keyframes to a new position. This may be useful for you.

Paint uses two transformations, the Clone offset (when using Clone) and the transform from the layer. The problem here is that the original paint stroke location can’t be changed. For what you want to do, we would need a way to have an additional transform on the paint strokes to move them to a new position. We have talked about adding this feature as it would be applicable to a number of other tools.

As far as scripting, select Help > Customization guide and you will see a link for the Silhouette Scripting Guide. If you have any specific scripting questions, feel free to create a new post in the forum and our scripting expert can assist you.

1 Like