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"

Author Topic: trouble with painted weights  (Read 1877 times)

thecolclough

  • Sr. Member
  • ****
  • Posts: 889
  • 3D Ignoramus 1988-2002, Anim8or User 2002-present.
    • View Profile
    • www.mattghc.com
trouble with painted weights
« on: December 12, 2023, 10:36:24 am »

hi all, long time no post.  in a kinda weird spot in life in general atm, but the good news is i've had the urge to get back into Anim8or lately.

promptly ran into a problem while trying to build a simple pac-man-type shape: i made a sphere, chopped out a quarter of it, and tried to use weight paints to control how much each longitudinal line moves when the bone is rotated.  the theory is, all the points circled in cyan (pic 1) should have a weight of 0.2, all the ones circled in green should have a weight of 0.4, etc, up to the ones on the blue edge having a weight of 1.0.  nice and simple in theory... except i can't figure out how to make the brush work consistently.  pic 2 shows the jagged mess i ended up with in Sequence mode.

i've read up on how the tool works, and while i can see the logic in the soft-edged brush, that behaviour really isn't much help for what i need to do.  the applied weight also seems to be affected by how quickly or slowly you move the brush over a given point, such that if you move too slowly then even with a very low weight setting (say 0.1) it will happily stack that value several times over and end up with an actual weight of anything up to 1.0.

am i missing something here?  is there a way to ensure that a certain point gets a certain weight, and ONLY that weight, without manually editing the file in a text editor?

thanks in advance :)
Logged

ENSONIQ5

  • Hero Member
  • *****
  • Posts: 1012
    • View Profile
    • Mission Backup Earth
Re: trouble with painted weights
« Reply #1 on: December 14, 2023, 06:54:47 am »

Hi thecolclough, long time no post too!  I'm not sure there's a way to numerically control weights at each point, at least I'm not aware of one.  For your figure you might be better off running a set of radial bones from the root, each aligning with a set of points (eg. a separate bone for the cyan-circled points, separate bone for the green-circled points, etc.) with the points weighted 100% to their respective bones.  This method would also maintain the relative distances of all points from the object's centre which wouldn't necessarily be the case with a single bone so there should be less distortion of the figure.  On the downside there would be more bones to wrangle in Sequence mode.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2121
    • View Profile
Re: trouble with painted weights
« Reply #2 on: December 14, 2023, 03:18:33 pm »

It is possible to edit the weights, but not particularly easy.

1) After you've done the initial painted weights, go into the Object Editor and in point edit mode you can double click on a point to see it's number.

2) Save the .an8 project and open it in a text editor such as notepad.

3) Find the figure, and the object you're interested in and look for the "weights" section.

4) Count over to the point that you're interested in and set the weights that you want. The format is: (# of weights for point 0 (bone#1 weight#1) ... (bone#n weight#n)) (#weights point 1...)

        weights { "mesh01"
          (1 (0 1))(2 (0 0.956) (1 0.044))(2 (2 0.874) (0 0.126))(1 (0 1))
          (2 (1 0.986) (0 0.014))(1 (0 1))(3 (2 0.924) (1 0.045) (0 0.031))
          (2 (1 0.865) (0 0.135))(1 (0 1))(2 (0 0.835) (2 0.165))
          (2 (1 0.856) (0 0.144))(1 (0 1))(3 (2 0.745) (1 0.168) (0 0.087))
          (3 (1 0.596) (0 0.300) (2 0.104))(1 (0 1))(1 (0 1))
          (2 (1 0.855) (0 0.145))(1 (0 1))(2 (2 0.690) (0 0.310))(1 (0 1))
        }

In this example point 0 has one weight, it's for bone #0 and a weight of 1.
Point 1 has two weights, 0.956 for bone #0 and 0.044 for bone #1.

Like I said, it's not easy!

I've attached this example.
Logged

thecolclough

  • Sr. Member
  • ****
  • Posts: 889
  • 3D Ignoramus 1988-2002, Anim8or User 2002-present.
    • View Profile
    • www.mattghc.com
Re: trouble with painted weights
« Reply #3 on: December 15, 2023, 07:00:02 am »

thanks for the feedback, gents.  good to know i was being stupid and overlooking a big obvious button somewhere :P

if this pac-man shape was the end goal, then i'd definitely run with Ensoniq's suggestion.  but (and i suppose i should have clarified this in my original post) this is actually just a test, trying to figure out rigging methodology for an organic character i'm planning to build.  i had a look at my file in a text editor and figured out how to do what Steve describes, which will be a nuisance to do but should give the result i want.  funnily enough, the distortion Ensoniq mentioned actually seems to give a pretty good approximation of the way the soft tissues deform when you move certain joints, which is a nice bit of serendipity - pic attached.

so - would it be possible to have a 'hard brush' behaviour option?  something like this: brush weight no longer trails off towards the edges, so if you hit a point it will always get the same treatment.  if the point's current influence from the selected bone is less than the brush weight setting, then it gets raised to that value (with all other current influences maintaining their proportions relative to each other as they reduce).  if the point already has an influence from the selected bone equal to or higher than the brush weight setting, then it gets ignored.
Logged