0
$\begingroup$

I am iterating through vertices and applying `bpy.ops.transform.skin_resize" to each vertex.

In the info panel, I can see that the correct value is being applied to each vertex, but in the viewport, I see something very different. The two branches on this structure should have an equal skin radius, but they do not. I can see in the info panel that the values being applied are 0.75, 0.5, 0.25, 0.25, where the bottom vertex is 0.75 and each branch vertex is 0.25.

This is exactly how I want my script to execute. However, I can see in the viewport that a very different scale is being applied to the vertices. I have attached the code block responsible for the skin resize operation and a snapshot of my info panel after running the script.

It seems as if the scale is being applied cumulatively, even though the skin_resize transform values are not accumulating.

# Iterate over each vertex and set its skin size
for i, vert in enumerate(bm.verts):
    # Select the vertex
    bm.select_flush(False)
    vert.select = True
    bpy.ops.transform.skin_resize(value=((size-sizes[i])/size, (size-sizes[i])/size, (size-sizes[i])/size))
    vert.select = False

enter image description here

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Hello and welcome. Please use a title that matches the content of the post. It should read like a question, be descriptive but succinct, unique and identifying, summarizing the problem so that anyone searching for similar issues is likely to find this. Remove anything superfluous, avoid using words like "this", "help with", "issue" or "question about", instead describe what "it" is. Remember, your title is the first thing visitors see, answers you get depend heavily on it. See What is the problem of asking “How do I do this?" $\endgroup$ Commented Jun 7 at 22:49

1 Answer 1

1
$\begingroup$

According to the docs and a rapid test, the value parameter is expecting a scale factor, not an absolute value. So when you use value=(0.5, 0.5, 0.5), the vertex' current Radius X and Radius Y will be halved. If you use value=(2, 2, 2), it will be doubled.

So every time you run the script, the values do multiply.

Interesting to note that the Z component doesn't seem to matter.

$\endgroup$

You must log in to answer this question.

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