0
$\begingroup$

I would like to create a "root-like mesh system" using only the Python API of Blender as I can use it in different projects and generate a large number of meshes without opening Blender.

Before this Blender part, I have created a script that generates an undirected graph and store the ID of each node, it's coordinate, parents IDs and children IDs in a JSON file.

Given that data I would like to create a mesh of the graph.

I have different ideas about how to investigate such as:

  • Create vertex at each node and vertices between them, then add a cylinder mesh around it
  • Create splines following the graph pattern then add a cylinder mesh around it

I would like some advice about how to proceed and if you have any other ideas.

$\endgroup$
7
  • $\begingroup$ Also skin modifier can be used for this. The disadvantage of skin modifier is that it has a remesh-like (or boolean-like) behavior in that it creates inconsistent animations with sudden changes to topology. The advantage is that it creates (sometimes buggy) smoothed connections on intersections. $\endgroup$ Commented Jun 6, 2023 at 9:26
  • $\begingroup$ Oh nice, I did not knew about this one. Thank you very much, the roots are empty inside, does it create holes within the root at each intersections ? $\endgroup$ Commented Jun 6, 2023 at 9:29
  • $\begingroup$ The skin modifier will not create internal faces i.imgur.com/LMGD52o.png $\endgroup$ Commented Jun 6, 2023 at 10:25
  • $\begingroup$ Nice ! Have you done this example using the Blender Python API ? $\endgroup$ Commented Jun 6, 2023 at 15:16
  • $\begingroup$ No, but adding a skin modifier in Python is trivial: C.object.modifiers.new('', 'SKIN') and in my case I also added a subdivision modifier C.object.modifiers.new('', 'SUBSURF').levels = 2 $\endgroup$ Commented Jun 6, 2023 at 20:04

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.