Help - Search - Members - Calendar
Full Version: Expression, toon line and distance from camera
Hash, Inc. Forums > Technical Direction and Development (Learning Animation:Master) > A:M Rigging & Relationships > Expressions
Pages: 1, 2
DJBREIT
I wanted to know if there was a way to change the line thickness and/or toon bias with expression.

Click to view attachment

When you have a scene with objects in background they render with the same line thickness as the objects in foreground.. The problem with that is the background objects become black spots.

Is there a way to use expressions to make the line thickness and/or toon bias change size the farther away the object is from the camera.

An example line starts at 1 at 5' from camera reduce to .25 at 30' then stay at .25

I have look at the expressions on the camera and found how to get the line thickness and toon bias. But I don't know how to get the distance from the camera.

Any ideas
robcat2075
I believe the distance from the camera can be calculated from knowing the XYZ position of the camera and the object and there's probably a Pythagorean theorem thrown in there too.

X distance^3 * y distance^3 * z distance^3 = distance^3 ??

There won't be a single property that gives distance between two objects.
DJBREIT
how about a bone?
robcat2075
QUOTE(DJBREIT @ Feb 14 2011, 10:08 PM) *
how about a bone?


Bones have positions too. But a bone in a model probably won't have its World XYZ in its XYZ. (or maybe there's a way to find that?)

I'd put a new Null in the chor and constrain that to the bone and then read the XYZ of the NULL
DJBREIT
The camera has the X,Y,X, on it's translates so I can use those.
Now I need need to figer out what I can use for the distance from the camera.
I need sleep wacko.gif
robcat2075
QUOTE(DJBREIT @ Feb 14 2011, 10:56 PM) *
Now I need need to figer out what I can use for the distance from the camera.


we covered that already

QUOTE
I believe the distance from the camera can be calculated from knowing the XYZ position of the camera and the object and there's probably a Pythagorean theorem thrown in there too.

X distance^3 * y distance^3 * z distance^3 = distance^3 ??


X position of the camera - x position of the object = the distance along the x axis

Like wise for the other axis

then you use the Pythagorean theorem to to find the straight line distance (the hypotenuse).


robcat2075
Correction on the formula

straightline distance^2 = x^2 + y^2 + z^2


I think that's the right one.
jakerupert
Very interesting!
Would be really really great, if you could get that to work!
HomeSlice
Would be pretty handy if we could save expressions as separate script files and load them into new projects. A script that changes the width of a toon line based on its distance from the camera would be useful in a wide variety of projects.
robcat2075
Can you copy from the expression editing window and past into a text editor?
itsjustme
QUOTE(robcat2075 @ Feb 15 2011, 03:59 PM) *
Can you copy from the expression editing window and past into a text editor?


Yessir, you can...I do it all the time.
mtpeak2
What if you had a bone in your models that, aimed at and scaled to reach the camera. Then use the scale of the bone as the multipler/divisor in the expression. The larger the scale, the smaller the line thickness.
robcat2075
QUOTE(mtpeak2 @ Feb 15 2011, 08:12 PM) *
What if you had a bone in your models that, aimed at and scaled to reach the camera. Then use the scale of the bone as the multipler/divisor in the expression. The larger the scale, the smaller the line thickness.


That's thinking!
DJBREIT
After going throw some tutorials I have come to the conclusion that I don’t have a clue on how to use the expression to accomplish this.... wacko.gif

The problem is the line thickness and bias is one number form. I can change it over time. But changing it within a frame over distance may not be possible.

Unless someone know how to change the thickness and bias numbers into something like a time channel that is based on distance not time or something like that.

This maybe a feature to throw in the AM report. If no one can come up with something I will add it to AM report.
mtpeak2
I've already tested using the scale to reach bone and it works, but I need to reverse the direction the line thickness change according to the scale.
robcat2075
There does seem to be something wrong with v16 in regards to creating expressions. I'll have to investigate further.

But In v15 this ca be done. Don't have time to whip up an example rightnow. possibly later, or someone else will chime in.
DJBREIT
Can you give a screne shot
mtpeak2
Here's an example of the toon lines automaticly adjusting according to the distance from the camera. I was able to reverse the line settings according to the scale.

There is a flaw though, when using multiple instances of the SAME model, the lines reference the first instance. I had to save it as another model. Another issue would be if you have a long object that is far and near, it will only have one line thickness, no perspective to the lines.

Rodney
Mark,
That is really great. I never would have considered that approach.
Once again I find myself in awe of what others can create with A:M.
jason1025
QUOTE(mtpeak2 @ Feb 16 2011, 04:43 PM) *
Here's an example of the toon lines automaticly adjusting according to the distance from the camera. I was able to reverse the line settings according to the scale.

There is a flaw though, when using multiple instances of the SAME model, the lines reference the first instance. I had to save it as another model. Another issue would be if you have a long object that is far and near, it will only have one line thickness, no perspective to the lines.



Could you make a quick video tutorial on how to set this expresion up?

Great work by the way.
DJBREIT
Great job smile.gif

QUOTE(mtpeak2 @ Feb 16 2011, 07:43 PM) *
Another issue would be if you have a long object that is far and near, it will only have one line thickness, no perspective to the lines.


I had a suspicion that was going to be the case.sad.gif But at least it works.smile.gif
mtpeak2
Sorry Jason, I don't do video tuts.

After some more testing, and I want to add a pose slider for a variable, I'll post a model that can be imported into your models (if that works).
jason1025
QUOTE(mtpeak2 @ Feb 16 2011, 06:18 PM) *
Sorry Jason, I don't do video tuts.

After some more testing, and I want to add a pose slider for a variable, I'll post a model that can be imported into your models (if that works).



Just curious, why anti vid tut? Aside from that it takes time and effort, and in the end 12 people will view it and 3 people will really get something out of it.
mtpeak2
You asked, I said no, and now I have to explain why I don't want to?
DJBREIT
Simple some people just don't like doing them.

Don't worry there is some people on the forum that do very good video tutorial. Maybe one of the can do one after he is done.
robcat2075
BTW, hasn't Holmes already done a tut on expressions in general?
itsjustme
Great stuff, Mark!
mtpeak2
Well, I ran into another issue, group priorities. The setup needs a group (all of the geometry) for the expression. This group overrides all the settings in the other groups. This should not be, if a surface property is "NOT SET", it should not override group properties that are set, no matter the hierarchy.

Groups have been an issue in v16. This probably won't be a priority for Steffen, since things have changed for things to work correctly, and his solutions to reports are materials. I'll have to see if that will work, but it will have to wait til tomorrow.
robcat2075
QUOTE(mtpeak2 @ Feb 16 2011, 10:20 PM) *
This should not be, if a surface property is "NOT SET", it should not override group properties that are set, no matter the hierarchy.

Groups have been an issue in v16.


Steffen has ventured into this during v16 and I think he found that a nominal fix broke many other things.

I think the solution is to use a material on the group somehow rather than set the parameters directly in the group. I may be recalling that incompletely.
jason1025
QUOTE(mtpeak2 @ Feb 16 2011, 07:30 PM) *
You asked, I said no, and now I have to explain why I don't want to?



You must not have kids. Yes you have to explain yourself.

Just kidding.

For such a smart guy you could use a class in social etiquette.

P.S. So could I
mtpeak2
Great, now I have to go to classes for social etiquette, what next?

P.S. Who says I'm smart to begin with?
HomeSlice
QUOTE(robcat2075 @ Feb 16 2011, 08:12 PM) *
BTW, hasn't Holmes already done a tut on expressions in general?


I never made a tut on expressions. I wish I had. I might have a clue about them then...
Looking on the forums for one now.
itsjustme
QUOTE(HomeSlice @ Feb 17 2011, 05:59 PM) *
QUOTE(robcat2075 @ Feb 16 2011, 08:12 PM) *
BTW, hasn't Holmes already done a tut on expressions in general?


I never made a tut on expressions. I wish I had. I might have a clue about them then...
Looking on the forums for one now.


There is a Tech Talk on Expressions here.
HomeSlice
QUOTE
There is a Tech Talk on Expressions here.

Thanks David.
DJBREIT
We can definitely use more tutorials on expressions. For a powerful little feature there not much in the way of tutorials.
itsjustme
QUOTE(DJBREIT @ Feb 17 2011, 09:51 PM) *
We can definitely use more tutorials on expressions. For a powerful little feature there not much in the way of tutorials.


I'll see if I can start a thread soon...it's been something I've been thinking about for a few months.
johnl3d
this is a good place to look also lots of info ,expressions samples

http://users.hol.gr/~sogou/animaster/expressions.htm
itsjustme
QUOTE(itsjustme @ Feb 17 2011, 10:31 PM) *
QUOTE(DJBREIT @ Feb 17 2011, 09:51 PM) *
We can definitely use more tutorials on expressions. For a powerful little feature there not much in the way of tutorials.


I'll see if I can start a thread soon...it's been something I've been thinking about for a few months.


I almost finished what I started tonight...but I'll have to wait until early Saturday morning to get it finished. I'll post it then.
HomeSlice
This solution doesn't use expressions, and it is kind of simplistic, but it seems to work. I think the original issue was that the toon lines on very small or far away objects obscured the models. Here are some settings that minimize that problem.
jason1025
QUOTE(itsjustme @ Feb 17 2011, 08:31 PM) *
QUOTE(DJBREIT @ Feb 17 2011, 09:51 PM) *
We can definitely use more tutorials on expressions. For a powerful little feature there not much in the way of tutorials.


I'll see if I can start a thread soon...it's been something I've been thinking about for a few months.



Thanks , much appreciated!
mtpeak2
I've managed to figure out the issue I was having. Using a material was the ticket. I still need to add the pose slider, as a multipler into the expression, for adjustability.

I've created a model to import into any model. Once imported and saved, drop the model into your chor and the toon lines will adjust according to the distance from the camera.

I'll post the import model as soon as I get the slider set and tested.

P.S. There was also talk about automatic bias adjustment. What settings would be needed for closeups or far away?
DJBREIT
smile.gif Yes the Toon Lines bias, that would go from low to high number so background props would render with less lines.

Also color method with it set as percent of underlying color. And change of color would be a bonus

If you can get the line thickness to work. These should not be much of a problem.

P.S. dose this work with object that reach from foreground to background?
mtpeak2
QUOTE
P.S. dose this work with object that reach from foreground to background?

No
robcat2075
Consider that toonlines that have perspective don't really exist in regular cartoons, either.
DJBREIT
QUOTE(mtpeak2 @ Feb 21 2011, 09:24 PM) *
QUOTE
P.S. dose this work with object that reach from foreground to background?

No


Bumper since I have a lot of scene with thing like streets, alley-way a canal and other things that would need that.

But I have not just been sitting idly by I have cooked up two reports for AM reports

One will be to set up the line thickness like the fog control. Which has a two set point control.

The second is a distance control module/program that would allow you to set up to ten point or more over a distance something like the time line but with a set number of points. This second part should be able to be added to a lot more then just the line thickness. Thing like all of the above, fog an a lot of other items that I have not thought of.

QUOTE(robcat2075 @ Feb 21 2011, 09:37 PM) *
Consider that toonlines that have perspective don't really exist in regular cartoons, either.

To some degree they do that on some cartoon and animes.
This shot is not an idea example but it shows it some what.
Click to view attachment
jason1025
I remember hearing an interview with the animation team for this show. They said they had similar problems with the outlines.

http://www.youtube.com/watch?v=S9ydrIMnwZY
mtpeak2
Here's the import model. I did not add anything for the bias.

Open your model in A:M. Right click on your models name and choose import>model. Import the "toon_lines_import" model and save your model to a new name. Drag and drop your model into a new chor. In the models user properties, there is a pose slider to adjust the overall line thickness to your liking (save settings). Then in the chor, position your model where you like and the toon lines will adjust according to the distance from the camera.

Note: Multiple instances of the same model will need to be saved as new models. Camera in the chor MUST be named to the default "Shortcut to Camera1", in order for the "Aim At" constraint to work.

mtpeak2
I was thinking, I may add the camera focal length into the expression. That way, when zooming in and out on a model, the toon lines will adjust thickness as well.
mtpeak2
Here's version 2. Toon lines adjust according to the camera's focal length as well.

jason1025
QUOTE(mtpeak2 @ Feb 21 2011, 10:26 PM) *
Here's version 2. Toon lines adjust according to the camera's focal length as well.



You have a gift for this sort of thing.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.