Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freestyle feature request #7

Open
e-crins opened this issue Dec 31, 2017 · 3 comments
Open

Freestyle feature request #7

e-crins opened this issue Dec 31, 2017 · 3 comments

Comments

@e-crins
Copy link

e-crins commented Dec 31, 2017

Hi.
I'm almost sure this is not the best place to ask. But I'd like to contact a freestyle dev. about a request....
I'd love to have line with correspond with local grey/light values of a model. The effect would be thick lines on the shadow side and thin lines on the light side of a model. And over all thicker lines on a model with a dark material and thinner lines on a model with a light material.
This would result in line drawings like I learned to make with Rotring pens.

@folkertdev
Copy link
Owner

This sounds like a scripting task. If you can get access to the "shadow value" at a particular point on a mesh, then you can use the freestyle python API to control the thickness.

The real tricky point is finding out the amount of light that hits a an object at a particular point. If you can find out a way I'm happy to help with the freestyle side of things.

@e-crins
Copy link
Author

e-crins commented Dec 31, 2017

Thanks for the reply. Hmmm Nice challenge to get me into python....
Are freestyle lines calculated from the render end result or inside Blender's 3D space?
Getting light values at a particular point on a .png file might be easier than finding the amount of light hitting a point in 3D and then manipulating this value with material settings of the object....

@folkertdev
Copy link
Owner

both are available

A freestyle stroke is (at the point python can manipulate it) a list-like container of StrokeVertex objects, which have a point attribute in 2d image space, and a point_3d attribute in 3d global space.

But I think the 2d options is the better one, 3d is always tricky and there might by tiny inaccuracies (to the 3d point you get is not actually on the object and stuff breaks).

A possible approach is to use blender textures (so load the image as a texture), to use
Texture.evaluate to get the pixel value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants