0
$\begingroup$

I need to render a model in pieces. That is, I need to split the model up so I can render it equally N number of times. However I need to capture every vertex in the process (or close too it). It doesn't matter in what order or angle they are captured from.

Trying to figure this out by moving a camera around by hand is not feasible. My first thought is to apply a mask using the camera itself. So when I render a portion of a model, that portion can be masked and hidden from the renderer on the next pass. This way I can iteratively shift the camera around the model and capture everything.

Using Python:

  1. Can you mask out parts of a model to hide it from the renderer?

  2. Can you apply this mask based on what is in the cameras field of view?

Unless of course there is a better approach. I'm open to any suggestions.

I should mention that I need to implement this using Python.

$\endgroup$
2
  • $\begingroup$ Can you share an example of the result you want? $\endgroup$
    – Ed Tate
    Commented Oct 7, 2021 at 19:41
  • $\begingroup$ This should be possible with animation nodes. My thought process: Create a cone representing your fov (or a pyramid), use animation nodes to take apart your mesh and rebuild only what's inside the cone (volume). If I'm not mistaken you can convert a node-tree into a python script. $\endgroup$ Commented Oct 7, 2021 at 20:04

1 Answer 1

0
$\begingroup$

This isn't a python solution, this is a shader solution.

The idea is to vertex paint or weight paint each group you want to have, then use this as a mask in the shader.

Here is an example: Each face of the cube has been vertex painted such that the front face's color has 100% red, the side 100% green and top 100% blue.

the 3 mix shaders here will filter out any face that doesn't have 100% of the respective color. Set your shader setting to use 'Alpha Clip'

example cube with each face selectively isolated with a shader mask

You could then add the vertices to the mask group as you progress using python

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .