3D rig!!!

Have you come up with a good Moho trick? Need help solving an animation problem? Come on in.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
synthsin75
Posts: 10266
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

I cannot promise nothing but when I have enough time, maybe, I'll take a look...
Like I said, it's not real important. If It requires reworking the whole script, don't do it. I'm sure there are much better things for one of our awesome scripters to be doing. :wink:
User avatar
synthsin75
Posts: 10266
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Mmm, having some trouble at the moment.

I did a complex head with hair and eyes, but I'm having problems setting up the 3D bones. After doing a lot of work, I realized that I needed a couple of extra points to anchor sub-object (mX/mY) rotations. I'm guessing that adding these is why I'm getting 'attempt to index local BRy' errors.

I was hoping that I could get away with this so I wouldn't have to redo the whole side view. :roll: Oh well, I figured it wouldn't work.


Aside from that it's coming along well. I did some simple tests and found out that things like lip-sync should work out pretty easy! Once again, these scripts are awesome! :D


Would there be anyway to maybe find the points or bones that are causing these kinds of errors? Or maybe even make the lua console print a selected bone/point's internal ID? If I could do this then I could compare changes to see if they'll still work. (I'm assuming that these scripts reference the internal ID)

Just some thoughts. :wink:
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

synthsin75 wrote:Would there be anyway to maybe find the points or bones that are causing these kinds of errors? Or maybe even make the lua console print a selected bone/point's internal ID? If I could do this then I could compare changes to see if they'll still work. (I'm assuming that these scripts reference the internal ID)
Please paste here what the console says. Then I can discover in which line is the problem happening and place a debug print line there :)
User avatar
synthsin75
Posts: 10266
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Code: Select all

...AS\scripts\3Dgrid.lua:146: attempt to index local 'BRy' (a nil value) 
That would be awesome. I'm not sure though if seeing the internal info would tell me which points/bones are the problem. But anything is worth a try. :wink:
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

synthsin75 wrote:

Code: Select all

...AS\scripts\3Dgrid.lua:146: attempt to index local 'BRy' (a nil value) 
That would be awesome. I'm not sure though if seeing the internal info would tell me which points/bones are the problem. But anything is worth a try. :wink:
3Dgrid.lua but which version? I assume you're using version 10?.

Try this:

http://www.darthfurby.com/genete/Scripting/3Dgrid11.lua

and tell me if it works.

-G
User avatar
synthsin75
Posts: 10266
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

3Dgrid.lua but which version? I assume you're using version 10?.
Sorry, yeah it's version 10.

Just ran version 11 in a tested and working model. Got lua error "...AS\scripts\3Dgrid11.lua:108: 'then' expected near 'print' "

I went ahead and added a 'then' after " if (BRx == nil) " & " if (BRy == nil) " on lines 107 and 111.

Okay, I had to figure out how to reproduce what I was doing wrong to get the original error( ...AS\scripts\3Dgrid.lua:146: attempt to index local 'BRy' (a nil value)) to test this.
What causes this error is having fewer points selected when running the side view script. Totally user error.

Now it gives the error:

Code: Select all

...AS\scripts\3Dgrid11.lua:112: attempt to concatenate local 'tname' (a table value) 
I imagine this print function wouldn't be needed if the side view script could somehow check it's bone count against the front view.

But I wouldn't worry too much about all this. Like I said, it was user error. Mmm, maybe just a pop-up alert message for that line 146 error that tells the user they have a different amount of points in their front and side views.

Thanks for all of the attention. :wink:
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

The problem is that if I make a lot of user error debuging then the script does useless things all the time and performance goes down that now is too low.

Sorry for forget the "then" thing but I'm so lazy and didn't check out the script. It would be catched once you load it first time at parsing time.

Lately I have a more C++ mind where there isn't any then sentence ;)


If the number of points in the front and side views are not the same you probably should dump all the model and start it over. Unless you add / remove the different points maintaining the same internal numbers...

The best thing to avoid problems is give named groups to the points you need to locally rig BEFORE duplicate the layer. Then once you make the side view it would be very easy select the correct points for the automatic 3Drig.

-G
User avatar
synthsin75
Posts: 10266
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

The problem is that if I make a lot of user error debuging then the script does useless things all the time and performance goes down that now is too low.
Oh okay, in that case forget the error message idea. Performance is number one. :wink:
Sorry for forget the "then" thing but I'm so lazy and didn't check out the script. It would be catched once you load it first time at parsing time.
No problem. I'm just glad I can do that little bit with scripting. :)
The best thing to avoid problems is give named groups to the points you need to locally rig BEFORE duplicate the layer. Then once you make the side view it would be very easy select the correct points for the automatic 3Drig.
Yeah that's what I've started doing. I must have been missing some points when I was selecting for the side view. :oops: My mistake.

The lastest trouble is finding the right bones in a complex model. Is there anyway to reduce the size of the generated bones any more than I can already? What is the initial size (10 in the generation pop-up) determined by?

Code: Select all

			ptbone.fLength = diag:Mag()/GE_front3Drig3_2.ptscale
rxbone.fLength = diag:Mag()/GE_front3Drig3_2.ptscale
Lines 282 & 291 seem to be the scale in the 3Drig front 3.2 script. Bone length equals point scale? Is that what it says? How does it determine point scale?

Perhaps if I change the 'recurring' value of ptscale?

I'm trying, but these are probably dumb scripting questions. :oops: Let me know if I'm anywhere close to understanding any of this. :wink:
User avatar
synthsin75
Posts: 10266
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Damn it! :evil:

I'm so close to making something truely impressive, but I have made the side view of the same model like five times now. :roll: I keep missing some point groups that I need for that view (once the points of the two sides are 'stacked'). Arrrgh!

:) Just had to vent. Hopefully an update is soon. :wink:
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

Genete wrote:The best thing to avoid problems is give named groups to the points you need to locally rig BEFORE duplicate the layer. Then once you make the side view it would be very easy select the correct points for the automatic 3Drig.

if you make the groups before duplicate you don't need to create the groups again!!!! they go with the duplicated one. So if you need to 3D rig the Side view just select the same groups!

Use the original Translate Points form LM!.

-G

PS: regarding the other issues I'll reply this evening.
User avatar
synthsin75
Posts: 10266
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Yeah, I know that point groups are duplicated. I just didn't anticipate what groups I'd need once i started running the scripts. :roll:
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

The lastest trouble is finding the right bones in a complex model. Is there anyway to reduce the size of the generated bones any more than I can already? What is the initial size (10 in the generation pop-up) determined by?

Code: Select all

ptbone.fLength = diag:Mag()/GE_front3Drig3_2.ptscale
rxbone.fLength = diag:Mag()/GE_front3Drig3_2.ptscale
Lines 282 & 291 seem to be the scale in the 3Drig front 3.2 script. Bone length equals point scale? Is that what it says? How does it determine point scale?

Perhaps if I change the 'recurring' value of ptscale?

:arrow: In ge_front_3Drig3.2.lua script look for this section:

Code: Select all

function GE_front3Drig3_2Dialog:OnValidate()
	local b = true
	if (not self:Validate(self.ptscale, 5, 30)) then  -- those values (5, 30) can be customized
		b = false
	end
	return b
end
It checks if the scale to the pt bone (and to the Rx bone) would be accepted or not. Maximum and minimum values are [5,30]. You can change them for your convenience.

Notice that the default value is set once you run the scrip after start AS. It is 10 and comes from this line:

Code: Select all

GE_front3Drig3_2.ptscale = 10 -- dividing scale for the pt, Rx and Ry bones
but once you change it, it is kept until you leave AS and run it again. You can also alter that number too.

Understanding the lines:

Code: Select all

ptbone.fLength = diag:Mag()/GE_front3Drig3_2.ptscale
and

Code: Select all

rxbone.fLength = diag:Mag()/GE_front3Drig3_2.ptscale
it means that the resulting bone length will be the result of dividing the diagonal of the selected points to 3D rig by the ptscale value. So higher ptscale value decreases final bone length. Also if for some reason the diagonal is is a null vector [0.0, 0.0] then the diagonal is set to [0.5, 0]. See this code:

Code: Select all

		mesh:SelectedBounds(min,max)
		diag = max - min
		if (diag:Mag() == 0) then diag.x = 0.5 end
:arrow: Unfortunately there is not GUI interface for the 3Drig side script. The ptscale value is always set to 10. You can change it modifying this line:

Code: Select all

-- ***************************************************

-- Magnitude of the .pt bone in relation to the diagonal
-- of the selected points boundary.
-- a value of ptscale = 10 is sane 1/10 of the diagonal
-- beyond 30 could be insane.

-- ***************************************************

ptscale = 10
20 would be a good value.

Good luck
-G
User avatar
synthsin75
Posts: 10266
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Thank you sooo much, Genete!!! :D :shock:

I actually think I understood all of your explaination. It's really too bad that our script writers don't have time to do a scripting tutorial. A section by section break down of what the script does is very educational.

I won't ask for a scripting tutorial though. I'm more than happy to get these little hints now and then. :)

I was very surprised to see that I had guessed right about the bone length being related to the size (spread) of the selected points.

Let me just make sure I've got this. To change the default dividing factor for bone length in both the front and side scripts, all I have to do is change the 'ptscale=' value? And to change the input range for this, I just change the values before the note 'those values (5,30) can be customized'?

Thanks a lot!! :wink:
User avatar
synthsin75
Posts: 10266
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Post by synthsin75 »

Vern, I had another idea about how to maybe impliment a better way to select constraint bones. I don't know if this can be done.

What if you could assign constraint bones much like you assign point binding? This may be impossible, but I imagine having check boxes in the tool options. With one or more of these checked (one for each constraint) the first, or current, bone selected would be the target bone. The next bone selected would be it's constraining bone according to the option check boxes.

Basically this would get around the hugh list of names all together by doing it all with the actual bones. This may have to be a separate tool. I don't know if it could be added to a current tool, or not.

I imagine that this kind of tool would maybe highlight the constraining bone and show the constraints checked of any bone selected. I could imagine that being useful elsewhere.

Let me know if any of that is doable. Hell, if you can point me in the right direction, I'll try some copy/paste with the scripts to see what I can do.

:wink:
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Post by Genete »

synthsin75 wrote:Thank you sooo much, Genete!!! :D :shock:

I actually think I understood all of your explaination. It's really too bad that our script writers don't have time to do a scripting tutorial. A section by section break down of what the script does is very educational.

I won't ask for a scripting tutorial though. I'm more than happy to get these little hints now and then. :)

I was very surprised to see that I had guessed right about the bone length being related to the size (spread) of the selected points.
Unfortunately learning moho interface is a "stand-alone trip". Other thing is learning lua. There are lots of lua manuals out there. Just google them.
[Let me just make sure I've got this. To change the default dividing factor for bone length in both the front and side scripts, all I have to do is change the 'ptscale=' value?
Yes but for the SIDE rig script is a constant value. For the FRONT one is the initial value once you run the script for the first time in a AS session. After change it in the dialogue it is remembered in the "recurring values" area.
And to change the input range for this, I just change the values before the note 'those values (5,30) can be customized'?
Yes for the FRONT rig script only.

Thanks a lot!! :wink:
You're welcome :)
Post Reply