Freestyle Edges for Blender Script
Davdup a commencé cette discussion dans Suggestions and Ideas

Hi Scrubs!
One very small update that would allow a lot of easy customizations: adding this line to the import script:
bpy.ops.mesh.mark_freestyle_edge(clear=False)
after the edge crease and bevel weight lines...
Doing so we can use the line selection method with Freestyle Engine, and think about very cool features... (Blender/Cycle building instructions, animations... highlights... etc...)
Keep up the good work!
Cheers

David

5 réponses · Page 1 sur 1
Avatar de Scrubs
Administrateur

Thanks I can look into that for next update.

Thank you Scrubs! you rock...
Oh and speaking about Freestyle... You could also use the "Freestyle Line" option of the Freestyle materials in order to define a specific color for the ouline depending on the base color... for example a light blue line for the Blue parts, a grey line for the black parts... And we would have an amazing tool for Lego illustration creation! 😉 (Blender is an amazing tool for so many purposes!!)

Hi again...
I tried to look your scripts a little more closely, and I think I am quite close to implementing this...
I managed to declare the edges as Freestyle edges by adding the line:

    bpy.ops.mesh.mark_freestyle_edge(clear=False)

after line 74 in replace.py

I tried to implement also the line_color option for Freestyle line but this does not work...
I added a 'sRGB2' color definition (with alpha) in the colors.py like in the example below:

'1': {'type': 'solid', 'hex': 'F4F4F4', 'sRGB': [0.905, 0.905, 0.905], 'sRGB2': [1, 0, 0, 1]},

And I wanted to assign this color to the material.line_color slot, but I cannot find the right place to do that. I tried to add:
material.line_color = color['sRGB2']
after line 87 in functions.py but this does nothing...
Any advice??

UPDATE:
Finally this solution works, the problem was due to some kind of memory not flushing once the script has been run once... I had to close completly Blender and re-open/run the script and the color were correctly applied... I will make some more tests and post the results here for your comments! 😉

Thanks!

David

Here is a link to a quick test. Line colors need to be adjusted, but this is very promising! 😃
Scrubs, if you have a list of the line colors you use for each base color for the line rendering in the workshop render engine, I can use them for the Freestyle engine!
https://www.dropbox.com/s/8b3ut7u9b4cdicj/Viper_Support_Freestyle_test.png?dl😮

Avatar de Scrubs
Administrateur

I sent you private messages.

Publicité
2 participants
Avatar de Davdup
Avatar de Scrubs

LEGO, le logo LEGO, la minifigurine et les configurations des briques et tenons sont des marques déposées de LEGO Group of Companies. ©2024 The LEGO Group.

Mecabricks, le logo Mecabricks et tout le contenu non couvert par les droits d'auteur du groupe LEGO sont, sauf indication contraire, ©2011-2024 Mecabricks.