mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 04:27:42 +00:00
Refactor for blender 2.8 and new shader model
This commit is contained in:
@@ -25,12 +25,15 @@ void DeafBabe::BlenderInit(hecl::blender::PyOutStream& os) {
|
||||
" 'Organic':(0.19, 0.45, 0.2)}\n"
|
||||
"\n"
|
||||
"# Diffuse Color Maker\n"
|
||||
"from mathutils import Color\n"
|
||||
"def make_color(index, mat_type, name):\n"
|
||||
" new_mat = bpy.data.materials.new(name)\n"
|
||||
" if mat_type in TYPE_COLORS:\n"
|
||||
" new_mat.diffuse_color = TYPE_COLORS[mat_type]\n"
|
||||
" new_mat.diffuse_color = TYPE_COLORS[mat_type] + (1.0,)\n"
|
||||
" else:\n"
|
||||
" new_mat.diffuse_color.hsv = ((index / 6.0) % 1.0, 1.0-((index // 6) / 6.0), 1)\n"
|
||||
" col = Color()\n"
|
||||
" col.hsv = ((index / 6.0) % 1.0, 1.0-((index // 6) / 6.0), 1)\n"
|
||||
" new_mat.diffuse_color = tuple(col) + (1.0,)\n"
|
||||
" return new_mat\n"
|
||||
"\n"
|
||||
"bpy.types.Material.retro_unknown = bpy.props.BoolProperty(name='Retro: Unknown (U)')\n"
|
||||
@@ -189,8 +192,6 @@ void DeafBabe::BlenderInit(hecl::blender::PyOutStream& os) {
|
||||
" return len(material_index)-1\n"
|
||||
" else:\n"
|
||||
" mat = make_color(len(material_dict), mat_type, mat_name)\n"
|
||||
" mat.diffuse_intensity = 1.0\n"
|
||||
" mat.specular_intensity = 0.0\n"
|
||||
" mat.retro_unknown = ((data >> 0) & 1)\n"
|
||||
" mat.retro_surface_stone = ((data >> 1) & 1)\n"
|
||||
" mat.retro_surface_metal = ((data >> 2) & 1)\n"
|
||||
|
||||
Reference in New Issue
Block a user