Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Can't edit subd vertices using python

$
0
0

Hi,

I am attempting to modify the coordinates of a subd vertex using python. I thought that editing the vertex ControlNetPoint would work (docs say it has both a setter and getter), but the subd does not change. Am I doing something wrong? Code posted below.

Also, it would great to be able to edit the vertex surface point directly rather than the control point. I see that vert.SurfacePoint() returns a Point3d object, but not sure if this is editable or not. Is it possible to edit the surface point directly?

import Rhino

def edit_subd_verts():
    filter = Rhino.DocObjects.ObjectType.SubD
    rc, objref = Rhino.Input.RhinoGet.GetOneObject("Select SubD", False, filter)
    if not objref or rc != Rhino.Commands.Result.Success: return
    
    subd = objref.SubD()
    if not subd: return
        
    vert = subd.Vertices.First
    print(vert.ControlNetPoint)
    vert.ControlNetPoint.X = 30.0 # This has no effect
    
edit_subd_verts()

I am currently using Rhino 7 SR12 2021-11-9 on Windows 10.

Cheers,
Michael

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles