Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Pages: 1 2 [3] 4

Author Topic: Script Request Thread  (Read 106137 times)

nemyax

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: Script Request Thread
« Reply #30 on: January 17, 2015, 04:26:00 am »

A request for an edge and point dissolve script, if I may.
Here's how it should work:

Edge dissolve (with cleanup)


Edge dissolve (without cleanup)


Vertex dissolve


I'm not sure how best to handle the UVs on seams during edge dissolve. Probably just pick one of the sides and arrange them between the affected UVs on that side.

Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Script Request Thread
« Reply #31 on: January 21, 2015, 03:32:39 pm »

Hey nemyax, I had kind of hinted at this to Steve before, with this as a form of auto-healing after deleting a point or edge (with cleanup).

I have an Anim8or UI overlay in the works that I'll be embedding features like this in. I was thinking of adding this dissolve feature as a script, and whenever you hit the delete key it'll run the script and dissolve the point or edge instead of performing the original delete command. The only issue is that command scripts like this don't have undo capability.
Logged

nemyax

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: Script Request Thread
« Reply #32 on: January 22, 2015, 02:49:23 am »

I had kind of hinted at this to Steve before

Ah, then you should keep trying! Steve is very keen on the important stuff if you can prove it's important =)
I hadn't realized how useful this would be until I implemented it - so thanks for keeping on reminding me about it until I finally did something :)
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: Script Request Thread
« Reply #33 on: February 11, 2015, 10:55:59 pm »

I understand the value of some form of edge/point/face dissolve - they are on my list of things to do.  But I don't know when I'll get to them.

It's not clear how to implement them however.  It's easy to introduce convex faces which are invalid faces. nemyax there are several in your examples that won't properly render.  So I'll describe this in a bit more algorithmic manner what I'd propose:

For edge dissolve I'd propose something like your with clean-up:

1) Find connected groups of faces that are adjacent via a selected edge.
2) Delete all selected edges and and adjacent faces.
2) If any end points are left without any edges attached, delete them.
3) Rebuild faces from connected groups. There are a lot of possible problems: one example of many is if a ring of edges completely encircle a group of faces, then deleting them will create an island.  If anything strange like this is present, bail out and revert to the original mesh.
4) Convert any sequence of connected edges that are part of the same two faces into a single edge. (This is the "with clean-up" part.)

For point dissolve:

1) Selected points with 0 or 1 edge are deleted.
2) Those with 2 edges are replaced by a single edge. Adjacent faces, if any, are rebuild accordingly.
3) For those with 3 or more edges and have two edges each (i.e. a properly built mesh), delete all the edges and add a new face as above.  Again multiple problems can arise, such as islands.  These will cause Anim8or to bail-out.

For face dissolve:

1) Replace each selected face group and all it's edges and points with a single point at the group's center.
2) Rebuild adjacent faces with this new point in the place of all their deleted edges.
3) Delete degenerate faces (i.e. those with only two edges).

Then there's the concept of face and edge collapse, which is another topic ...
Logged

nemyax

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: Script Request Thread
« Reply #34 on: February 12, 2015, 03:58:30 am »

There are a lot of possible problems: one example of many is if a ring of edges completely encircle a group of faces, then deleting them will create an island.  If anything strange like this is present, bail out and revert to the original mesh.
Bailing out is one option. Another would be to go for the closest valid result. An example from Wings:



Perhaps this would be the "least surprise" choice in situations where you dissolve edges in multiple areas at once. But of course, it's your call.

For face dissolve:

1) Replace each selected face group and all it's edges and points with a single point at the group's center.
But this is collapsing =) Anim8or's Merge Faces already dissolves face groups.

Then there's the concept of face and edge collapse, which is another topic ...
Maybe this discussion should be snipped off the script request thread into its own?
Logged

polyGon_tError

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Script Request Thread
« Reply #35 on: March 13, 2015, 11:37:41 am »

well, look like you people forget about me! ... ok! ...

that is 'easy to do but can cause problem' kind of task as Steve mentioned above - due to inside-tech of 3D geometry or in other word tri/ quad formation cause overlapping face or blank face (if i am correct) and they apear incorrectly in render or viewport!

you may also give a try to some of my modeling tool script esp. rewind poliGon (can help to fix above mentioned error), Close-Edge, concave fix, Merge Helper etc. those tool can help doing it and i also added some texture support to them.

to Steve: kindly add undo support and suddent crash after running script. i am not sure but there is some kind of memory leak happening some time with running script over complex model!

to Raxx: can you please try my tool set again to see if ok (i tested but don't how they work with others)

... thank you all
Logged

nemyax

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: Script Request Thread
« Reply #36 on: March 13, 2015, 11:48:58 am »

polyGon_tError
I did try your scripts looking specifically for dissolve and collapse, but didn't find what I needed.
« Last Edit: March 13, 2015, 11:49:37 am by nemyax »
Logged

polyGon_tError

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Script Request Thread
« Reply #37 on: March 13, 2015, 12:04:44 pm »

you call it 'dissolve and collapse' and i (or other some time) call them 'remove and merge/ close'. try this way :)
Logged

nemyax

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: Script Request Thread
« Reply #38 on: March 13, 2015, 03:07:53 pm »

polyGon_tError
Your close-edge script doesn't collapse individual pieces of selection. It just merges all vertices affected by the selection. I've been emulating collapsing in the recent versions with "scale to almost-zero then convert to points then merge". Works well enough.
I've found nothing resembling a dissolve among these tools.
Logged

ronaldefarmer

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Ron's Website
Re: Script Request Thread
« Reply #39 on: May 17, 2015, 04:41:18 pm »

Hello Anim8ors,

I don't know what type of thing is possible with scripts, but I have been wondering about these:

Would it be possible to write a script that will automatically change a material's texture for each frame while rendering a movie by flipping through a series of images in a specified folder and applying each one in sequence?

Would it be possible to make a script that will automatically move, scale, and rotate texture UV mapping for an object (so that the texture is animated) while rendering a movie.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Script Request Thread
« Reply #40 on: May 17, 2015, 09:07:26 pm »

It looks like your first request might be possible. I'll get back to you with a solution if it is.

As for the second one, unfortunately, we can't animate UVs in the scene editor since we can't access the actual mesh data yet.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Script Request Thread
« Reply #41 on: May 18, 2015, 08:59:28 pm »

Well...never mind. I was able to implement it, but it's too unpredictable. Sometimes it works, sometimes it doesn't, and it's a lot of hassle to set up.

The best solution is still probably Terranim8or
Logged

ronaldefarmer

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Ron's Website
Re: Script Request Thread
« Reply #42 on: May 20, 2015, 06:05:56 pm »

Thanks for trying, Raxx.
« Last Edit: May 20, 2015, 11:44:12 pm by ronaldefarmer »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Script Request Thread
« Reply #43 on: January 16, 2016, 09:55:56 am »

@ronaldefarmer fyi, I revisited this and figured out most of the issues. It's more doable now, though still requires some work.


The above vid shows three image sequences, two of which are the walking and idle animations applied to one object, while the poof cloud at the beginning is applied to a separate object. It doesn't do it the Terranim8or way of (if I remember correctly) making multiple materials and objects and swapping visibility. Instead it uses a single objects and swaps textures.

If there's any interest in it, I'll tidy up the script and make a step-by-step tutorial on how to use it.
« Last Edit: January 16, 2016, 06:12:31 pm by Raxx »
Logged

captaindrewi

  • Sr. Member
  • ****
  • Posts: 490
  • errm...errr?
    • View Profile
Re: Script Request Thread
« Reply #44 on: January 16, 2016, 08:53:07 pm »

Always interesting at the very least.Also a very enjoyable vid snippet.
Logged
!
Pages: 1 2 [3] 4