@@ -739,8 +739,8 @@ def exp_color_ramp(from_node, exp_list):
739
739
level = get_expression (from_node .inputs ['Fac' ], exp_list )
740
740
741
741
curve_idx = exp_scalar (idx , exp_list )
742
- prefer_custom_nodes = datasmith_context ["prefer_custom_nodes " ]
743
- if not prefer_custom_nodes :
742
+ compatibility_mode = datasmith_context ["compatibility_mode " ]
743
+ if compatibility_mode :
744
744
pixel_offset = exp_scalar (0.5 , exp_list )
745
745
vertical_res = exp_scalar (1 / DATASMITH_TEXTURE_SIZE , exp_list ) # curves texture size
746
746
n = Node ("Add" )
@@ -1477,7 +1477,7 @@ def fill_umesh(umesh, bl_mesh):
1477
1477
loops .foreach_get ("normal" , normals )
1478
1478
normals = normals .reshape ((num_loops , 3 ))
1479
1479
normals = normals @ matrix_normals
1480
-
1480
+
1481
1481
m .transform (matrix_datasmith )
1482
1482
1483
1483
#finish inline mesh_copy_triangulate
@@ -2080,7 +2080,7 @@ def get_datasmith_curves_image():
2080
2080
TEXTURE_MODE_BUMP = "6" # this converts textures to normal maps automatically
2081
2081
2082
2082
# saves image, and generates node with image description to add to export
2083
- def save_texture (texture , basedir , folder_name , minimal_export = False , experimental_tex_mode = True ):
2083
+ def save_texture (texture , basedir , folder_name , minimal_export = False , use_gamma_hack = False ):
2084
2084
name , image , img_type = texture
2085
2085
2086
2086
log .info ("writing texture:" + name )
@@ -2131,8 +2131,7 @@ def save_texture(texture, basedir, folder_name, minimal_export = False, experime
2131
2131
elif image .colorspace_settings .is_data :
2132
2132
n ['texturemode' ] = TEXTURE_MODE_SPECULAR
2133
2133
n ['srgb' ] = "2" # only read on 4.25 onwards, but we can still write it
2134
- if not experimental_tex_mode :
2135
- # use this hack if not using experimental mode
2134
+ if use_gamma_hack :
2136
2135
n ['rgbcurve' ] = "0.454545"
2137
2136
2138
2137
n ['texturefilter' ] = "3"
@@ -2164,7 +2163,7 @@ def collect_and_save(context, args, save_path):
2164
2163
"materials" : [],
2165
2164
"material_curves" : None ,
2166
2165
"metadata" : [],
2167
- "prefer_custom_nodes " : args ["prefer_custom_nodes " ],
2166
+ "compatibility_mode " : args ["compatibility_mode " ],
2168
2167
}
2169
2168
2170
2169
log .info ("collecting objects" )
@@ -2348,9 +2347,9 @@ def collect_and_save(context, args, save_path):
2348
2347
log .info ("writing textures" )
2349
2348
2350
2349
tex_nodes = []
2351
- use_experimental_tex_mode = args ["experimental_tex_mode " ]
2350
+ use_gamma_hack = args ["use_gamma_hack " ]
2352
2351
for tex in datasmith_context ["textures" ]:
2353
- tex_node = save_texture (tex , basedir , folder_name , minimal_export , use_experimental_tex_mode )
2352
+ tex_node = save_texture (tex , basedir , folder_name , minimal_export , use_gamma_hack )
2354
2353
tex_nodes .append (tex_node )
2355
2354
2356
2355
log .info ("building XML tree" )
@@ -2372,7 +2371,6 @@ def collect_and_save(context, args, save_path):
2372
2371
for mat in material_nodes :
2373
2372
n .push (mat )
2374
2373
2375
- print ("Using experimental tex mode:%s" , use_experimental_tex_mode )
2376
2374
for tex in tex_nodes :
2377
2375
n .push (tex )
2378
2376
0 commit comments