Deleting Faces as they are drawn -splats
-
I've been working on a plugin and it erases faces as they are drawn with a simple entities observer. It just erases every face.
It worked great at first, but I keep expanding what the observer is doing. And somewhere along the line I've got it so that it splats a lot now. I think its because I'm doing things inside the start/commit stack of the rectangle tool.
But how would I queue up the face to deleted once the tool is done making the rectangle? Does that make sense?
-
face.erase! if face and face.valid?only tries to erase a face if it [still] exists... -
I'll play with that, but I'm 99% sure the face still exists when I try to erase it. I think it is being erased correctly, and it is only after the rectangle tool tries to complete itself that it splats.
-
It's not good to change the entities from within the observer method. You can use
EntitiesObserver.onElementAddedto build references to the created faces, and then erase them fromModelObserver.onTransactionCommit. -
Yea, trying to do any modification to the model in reaction to an observer event is asking for trouble. ( see my old DoubleCut thread ).
Even stacking things off to onTransactionCommit isn't reliable, because onTransactionCommit doesn't map to model.commit_operation. -
You may need to combine your responces with a
ToolsObserver
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement