Notifications
Clear all

[Closed] Lock Vert/Edges from moving/being selected?

I’m trying to figure out how to lock them as it says in the title.
Also, it would be nice to be able to make those verts/edges “glow” orange. I would assume I’d have to use some drawing methods for that though?

But, to lock them, I’m trying to use

polyop.setEdgeFlags <Poly poly>  <edgelist> <int flag> mask:<int=0> undoable:<boolean=false>

But, this seems to lock them, but not the ones selected/chosen but all edges. Then when I go to unlock them, nothing happens , using Bit 25, or the ones I did want to lock are unlocked and the rest aren’t?

Am I going about this the right way?

Thanks

10 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

I don’t think that you can use any flag to lock a vert/edge. But you can protect vertices from selection by hiding them.

Hmm… Yeah, I was thinking about that.

That could work. But it would be safer/more reliable I think to be able to
lock them down another way if possible. Mainly since my script I’d use this in, will
work on all verts/edges/faces/borders if nothing is selected.

But I guess I could check for visibility in that circumstance…

I mainly wanted to avoid it, if the user had things hidden for a certain reason, like faces, but then wanted to lock other faces during the operation.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

but the thing is that you can’t lock verts/edge/face to prevent its editing. What I did… I used when construct change handler to get a fact of any geo change and set all “protected” vertices back to their “locked” positions.

could you add a #selectionSetChanged callback handler

and use

polyop.getFacesByFlag <Poly poly> <int flag> mask:<int maskflag>
polyop.getEdgesByFlag <Poly poly> <int flag> mask:<int maskflag>
polyop.getVertsByFlag <Poly poly> <int flag> mask:<int maskflag>

and subtract the resultant bit array from the current selection set. while the handler is in place it “should” be impossible to select anything with the specific flag set.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

i don’t think it might work. #selectionSetChanged fires when node selection changed… not sub objects.
when selection change construct might be used.

yep my bad.

Cool, that sounds like it could work.

How do I use this code though? Would I set the flag to 5, and mask to 0? How do I clear those then? That was the main issue I was having : \


[b][b]polyop[/b][/b].[b][b]getFacesByFlag[/b][/b] <Poly poly>  <int flag> [b][b]mask[/b][/b]:<int maskflag>

now i think it’s a right moment to tell why you want to protect some vertices…

I have made a shrink wrap tool. It lets you retopo LowPoly Geo to other Geo. You select verts/edges/faces and it brings them to the surface, to whatever offset value you set. Among other options.

I found myself forgetting to ignore the border verts/edges when doing it on my own projects, and then they get shifted off of their 0,0 plane or symmetry line. So if I could lock things down, I wouldn’t have to think about it. Also if you want to lock certain things down, then just select everything else to make it faster, and run the script, that would be nice too.

I know another shrink wrap script lets you lock/ignore border edges. I should maybe check that one again and see if I can access the code for ideas.

http://www.youtube.com/watch?v=n724G7uMuPE

Mine is sort of like this, but lets you work more how you want, using modifiers and ect.
Also I think mine might be faster to build the destination mesh for moving to.

Anyways, I guess I could just let the user only lock the border edges, but I’d rather not.
But that might be the best way. I forgot to mention, the user can add/remove geo while shrink wrapping too, so locking verts/edges might fail/not work right all the time.