Newer
Older
# POV object modifiers such as
# hollow / sturm / double_illuminate etc.
Maurice Raybaud
committed
write_object_modifiers(ob, file)
# Importance for radiosity sampling added here:
tab_write("radiosity { \n")
tab_write("importance %3g \n" % importance)
tab_write("}\n")
tab_write("}\n") # End of mesh block
ob_eval.to_mesh_clear()
Maurice Raybaud
committed
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
continue
# ------------ Povray Primitives ------------ #
# Also implicit elif (continue) clauses and sorted after mesh
# as less often used.
if ob.pov.object_as == 'PLANE':
tab_write("#declare %s = plane{ <0,0,1>,0\n" % povdataname)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
write_object_modifiers(ob, file)
# tab_write("rotate x*90\n")
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'SPHERE':
tab_write(
"#declare %s = sphere { 0,%6f\n" % (povdataname, ob.pov.sphere_radius)
)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
write_object_modifiers(ob, file)
# tab_write("rotate x*90\n")
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'BOX':
tab_write("#declare %s = box { -1,1\n" % povdataname)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
write_object_modifiers(ob, file)
# tab_write("rotate x*90\n")
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
Maurice Raybaud
committed
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
if ob.pov.object_as == 'CONE':
br = ob.pov.cone_base_radius
cr = ob.pov.cone_cap_radius
bz = ob.pov.cone_base_z
cz = ob.pov.cone_cap_z
tab_write(
"#declare %s = cone { <0,0,%.4f>,%.4f,<0,0,%.4f>,%.4f\n"
% (povdataname, bz, br, cz, cr)
)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
write_object_modifiers(ob, file)
# tab_write("rotate x*90\n")
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'CYLINDER':
r = ob.pov.cylinder_radius
x2 = ob.pov.cylinder_location_cap[0]
y2 = ob.pov.cylinder_location_cap[1]
z2 = ob.pov.cylinder_location_cap[2]
tab_write(
"#declare %s = cylinder { <0,0,0>,<%6f,%6f,%6f>,%6f\n"
% (povdataname, x2, y2, z2, r)
)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
# cylinders written at origin, translated below
write_object_modifiers(ob, file)
# tab_write("rotate x*90\n")
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'HEIGHT_FIELD':
data = ""
filename = ob.pov.hf_filename
data += '"%s"' % filename
gamma = ' gamma %.4f' % ob.pov.hf_gamma
data += gamma
if ob.pov.hf_premultiplied:
data += ' premultiplied on'
if ob.pov.hf_smooth:
data += ' smooth'
if ob.pov.hf_water > 0:
data += ' water_level %.4f' % ob.pov.hf_water
# hierarchy = obj.pov.hf_hierarchy
tab_write('#declare %s = height_field { %s\n' % (povdataname, data))
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
write_object_modifiers(ob, file)
tab_write("rotate x*90\n")
tab_write("translate <-0.5,0.5,0>\n")
tab_write("scale <0,-1,0>\n")
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'TORUS':
tab_write(
"#declare %s = torus { %.4f,%.4f\n"
% (povdataname, ob.pov.torus_major_radius, ob.pov.torus_minor_radius)
)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
write_object_modifiers(ob, file)
tab_write("rotate x*90\n")
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'PARAMETRIC':
tab_write("#declare %s = parametric {\n" % povdataname)
tab_write("function { %s }\n" % ob.pov.x_eq)
tab_write("function { %s }\n" % ob.pov.y_eq)
tab_write("function { %s }\n" % ob.pov.z_eq)
tab_write(
"<%.4f,%.4f>, <%.4f,%.4f>\n"
% (ob.pov.u_min, ob.pov.v_min, ob.pov.u_max, ob.pov.v_max)
)
# Previous to 3.8 default max_gradient 1.0 was too slow
tab_write("max_gradient 0.001\n")
if ob.pov.contained_by == "sphere":
tab_write("contained_by { sphere{0, 2} }\n")
else:
tab_write("contained_by { box{-2, 2} }\n")
tab_write("max_gradient %.6f\n" % ob.pov.max_gradient)
tab_write("accuracy %.6f\n" % ob.pov.accuracy)
tab_write("precompute 10 x,y,z\n")
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'ISOSURFACE_NODE':
tab_write("#declare %s = isosurface{ \n" % povdataname)
tab_write("function{ \n")
text_name = ob.pov.iso_function_text
if text_name:
node_tree = bpy.context.scene.node_tree
for node in node_tree.nodes:
if node.bl_idname == "IsoPropsNode" and node.label == ob.name:
for inp in node.inputs:
if inp:
tab_write(
"#declare %s = %.6g;\n" % (inp.name, inp.default_value)
)
text = bpy.data.texts[text_name]
for line in text.lines:
split = line.body.split()
if split[0] != "#declare":
tab_write("%s\n" % line.body)
else:
tab_write("abs(x) - 2 + y")
tab_write("}\n")
tab_write("threshold %.6g\n" % ob.pov.threshold)
tab_write("max_gradient %.6g\n" % ob.pov.max_gradient)
tab_write("accuracy %.6g\n" % ob.pov.accuracy)
tab_write("contained_by { ")
if ob.pov.contained_by == "sphere":
tab_write("sphere {0,%.6g}}\n" % ob.pov.container_scale)
else:
tab_write(
"box {-%.6g,%.6g}}\n" % (ob.pov.container_scale, ob.pov.container_scale)
)
if ob.pov.all_intersections:
tab_write("all_intersections\n")
else:
if ob.pov.max_trace > 1:
tab_write("max_trace %.6g\n" % ob.pov.max_trace)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
tab_write("scale %.6g\n" % (1 / ob.pov.container_scale))
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'ISOSURFACE_VIEW':
simple_isosurface_function = ob.pov.isosurface_eq
if simple_isosurface_function:
tab_write("#declare %s = isosurface{ \n" % povdataname)
tab_write("function{ \n")
tab_write(simple_isosurface_function)
tab_write("}\n")
tab_write("threshold %.6g\n" % ob.pov.threshold)
tab_write("max_gradient %.6g\n" % ob.pov.max_gradient)
tab_write("accuracy %.6g\n" % ob.pov.accuracy)
tab_write("contained_by { ")
if ob.pov.contained_by == "sphere":
tab_write("sphere {0,%.6g}}\n" % ob.pov.container_scale)
else:
tab_write(
"box {-%.6g,%.6g}}\n" % (ob.pov.container_scale, ob.pov.container_scale)
)
if ob.pov.all_intersections:
tab_write("all_intersections\n")
else:
if ob.pov.max_trace > 1:
tab_write("max_trace %.6g\n" % ob.pov.max_trace)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
tab_write("scale %.6g\n" % (1 / ob.pov.container_scale))
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'SUPERELLIPSOID':
tab_write(
"#declare %s = superellipsoid{ <%.4f,%.4f>\n"
% (povdataname, ob.pov.se_n2, ob.pov.se_n1)
)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
write_object_modifiers(ob, file)
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'SUPERTORUS':
rad_maj = ob.pov.st_major_radius
rad_min = ob.pov.st_minor_radius
ring = ob.pov.st_ring
cross = ob.pov.st_cross
accuracy = ob.pov.st_accuracy
gradient = ob.pov.st_max_gradient
# --- Inline Supertorus macro
file.write(
"#macro Supertorus(RMj, RMn, MajorControl, MinorControl, Accuracy, MaxGradient)\n"
)
file.write(" #local CP = 2/MinorControl;\n")
file.write(" #local RP = 2/MajorControl;\n")
file.write(" isosurface {\n")
file.write(
" function { pow( pow(abs(pow(pow(abs(x),RP) + pow(abs(z),RP), 1/RP) - RMj),CP) + pow(abs(y),CP) ,1/CP) - RMn }\n"
)
file.write(" threshold 0\n")
file.write(
" contained_by {box {<-RMj-RMn,-RMn,-RMj-RMn>, < RMj+RMn, RMn, RMj+RMn>}}\n"
)
file.write(" #if(MaxGradient >= 1)\n")
file.write(" max_gradient MaxGradient\n")
file.write(" #else\n")
file.write(" evaluate 1, 10, 0.1\n")
file.write(" #end\n")
file.write(" accuracy Accuracy\n")
file.write(" }\n")
file.write("#end\n")
# ---
tab_write(
"#declare %s = object{ Supertorus( %.4g,%.4g,%.4g,%.4g,%.4g,%.4g)\n"
% (povdataname, rad_maj, rad_min, ring, cross, accuracy, gradient)
)
if ob.active_material:
# pov_mat_name = string_strip_hyphen(bpy.path.clean_name(obj.active_material.name))
try:
material = ob.active_material
write_object_material_interior(material, ob, tab_write)
except IndexError:
print(me)
# tab_write("texture {%s}\n"%pov_mat_name)
write_object_modifiers(ob, file)
tab_write("rotate x*90\n")
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if ob.pov.object_as == 'POLYCIRCLE':
# TODO write below macro Once:
# if write_polytocircle_macro_once == 0:
file.write("/****************************\n")
file.write("This macro was written by 'And'.\n")
file.write("Link:(http://news.povray.org/povray.binaries.scene-files/)\n")
file.write("****************************/\n")
file.write("//from math.inc:\n")
file.write("#macro VPerp_Adjust(V, Axis)\n")
file.write(" vnormalize(vcross(vcross(Axis, V), Axis))\n")
file.write("#end\n")
file.write("//Then for the actual macro\n")
file.write("#macro Shape_Slice_Plane_2P_1V(point1, point2, clip_direct)\n")
file.write("#local p1 = point1 + <0,0,0>;\n")
file.write("#local p2 = point2 + <0,0,0>;\n")
file.write("#local clip_v = vnormalize(clip_direct + <0,0,0>);\n")
file.write("#local direct_v1 = vnormalize(p2 - p1);\n")
file.write("#if(vdot(direct_v1, clip_v) = 1)\n")
file.write(' #error "Shape_Slice_Plane_2P_1V error: Can\'t decide plane"\n')
file.write("#end\n\n")
file.write(
"#local norm = -vnormalize(clip_v - direct_v1*vdot(direct_v1,clip_v));\n"
)
file.write("#local d = vdot(norm, p1);\n")
file.write("plane{\n")
file.write("norm, d\n")
file.write("}\n")
file.write("#end\n\n")
file.write("//polygon to circle\n")
file.write(
"#macro Shape_Polygon_To_Circle_Blending(_polygon_n, _side_face, _polygon_circumscribed_radius, _circle_radius, _height)\n"
)
file.write("#local n = int(_polygon_n);\n")
file.write("#if(n < 3)\n")
file.write(" #error " "\n")
file.write("#end\n\n")
file.write("#local front_v = VPerp_Adjust(_side_face, z);\n")
file.write("#if(vdot(front_v, x) >= 0)\n")
file.write(" #local face_ang = acos(vdot(-y, front_v));\n")
file.write("#else\n")
file.write(" #local face_ang = -acos(vdot(-y, front_v));\n")
file.write("#end\n")
file.write("#local polyg_ext_ang = 2*pi/n;\n")
file.write("#local polyg_outer_r = _polygon_circumscribed_radius;\n")
file.write("#local polyg_inner_r = polyg_outer_r*cos(polyg_ext_ang/2);\n")
file.write("#local cycle_r = _circle_radius;\n")
file.write("#local h = _height;\n")
file.write("#if(polyg_outer_r < 0 | cycle_r < 0 | h <= 0)\n")
file.write(' #error "error: each side length must be positive"\n')
file.write("#end\n\n")
file.write("#local multi = 1000;\n")
file.write("#local poly_obj =\n")
file.write("polynomial{\n")
file.write("4,\n")
file.write("xyz(0,2,2): multi*1,\n")
file.write("xyz(2,0,1): multi*2*h,\n")
file.write("xyz(1,0,2): multi*2*(polyg_inner_r-cycle_r),\n")
file.write("xyz(2,0,0): multi*(-h*h),\n")
file.write("xyz(0,0,2): multi*(-pow(cycle_r - polyg_inner_r, 2)),\n")
file.write("xyz(1,0,1): multi*2*h*(-2*polyg_inner_r + cycle_r),\n")
file.write("xyz(1,0,0): multi*2*h*h*polyg_inner_r,\n")
file.write("xyz(0,0,1): multi*2*h*polyg_inner_r*(polyg_inner_r - cycle_r),\n")
file.write("xyz(0,0,0): multi*(-pow(polyg_inner_r*h, 2))\n")
file.write("sturm\n")
file.write("}\n\n")
file.write("#local mockup1 =\n")
file.write("difference{\n")
file.write(" cylinder{\n")
file.write(" <0,0,0.0>,<0,0,h>, max(polyg_outer_r, cycle_r)\n")
file.write(" }\n\n")
file.write(" #for(i, 0, n-1)\n")
file.write(" object{\n")
file.write(" poly_obj\n")
file.write(" inverse\n")
file.write(" rotate <0, 0, -90 + degrees(polyg_ext_ang*i)>\n")
file.write(" }\n")
file.write(" object{\n")
file.write(
" Shape_Slice_Plane_2P_1V(<polyg_inner_r,0,0>,<cycle_r,0,h>,x)\n"
)
file.write(" rotate <0, 0, -90 + degrees(polyg_ext_ang*i)>\n")
file.write(" }\n")
file.write(" #end\n")
file.write("}\n\n")
file.write("object{\n")
file.write("mockup1\n")
file.write("rotate <0, 0, degrees(face_ang)>\n")
file.write("}\n")
file.write("#end\n")
# Use the macro
ngon = ob.pov.polytocircle_ngon
ngonR = ob.pov.polytocircle_ngonR
circleR = ob.pov.polytocircle_circleR
tab_write(
"#declare %s = object { Shape_Polygon_To_Circle_Blending(%s, z, %.4f, %.4f, 2) rotate x*180 translate z*1\n"
% (povdataname, ngon, ngonR, circleR)
)
tab_write("}\n")
continue # Don't render proxy mesh, skip to next object
if csg:
duplidata_ref = []
_dupnames_seen = dict() # avoid duplicate output during introspection
for ob in sel:
Maurice Raybaud
committed
# matrix = global_matrix @ obj.matrix_world
if ob.is_instancer:
tab_write("\n//--DupliObjects in %s--\n\n" % ob.name)
Maurice Raybaud
committed
# obj.dupli_list_create(scene) #deprecated in 2.8
dup = ""
if ob.is_modified(scene, 'RENDER'):
# modified object always unique so using object name rather than data name
dup = "#declare OB%s = union{\n" % (
string_strip_hyphen(bpy.path.clean_name(ob.name))
)
else:
dup = "#declare DATA%s = union{\n" % (
string_strip_hyphen(bpy.path.clean_name(ob.name))
)
for eachduplicate in depsgraph.object_instances:
if (
Maurice Raybaud
committed
eachduplicate.is_instance
): # Real dupli instance filtered because original included in list since 2.8
_dupname = eachduplicate.object.name
_dupobj = bpy.data.objects[_dupname]
# BEGIN introspection for troubleshooting purposes
if "name" not in dir(_dupobj.data):
if _dupname not in _dupnames_seen:
print(
"WARNING: bpy.data.objects[%s].data (of type %s) has no 'name' attribute"
% (_dupname, type(_dupobj.data))
)
for _thing in dir(_dupobj):
print(
"|| %s.%s = %s"
% (_dupname, _thing, getattr(_dupobj, _thing))
)
_dupnames_seen[_dupname] = 1
Maurice Raybaud
committed
print("''=> Unparseable objects so far: %s" % _dupnames_seen)
else:
_dupnames_seen[_dupname] += 1
continue # don't try to parse data objects with no name attribute
# END introspection for troubleshooting purposes
duplidataname = "OB" + string_strip_hyphen(
bpy.path.clean_name(_dupobj.data.name)
)
dupmatrix = (
eachduplicate.matrix_world.copy()
) # has to be copied to not store instance since 2.8
dup += "\tobject {\n\t\tDATA%s\n\t\t%s\t}\n" % (
string_strip_hyphen(bpy.path.clean_name(_dupobj.data.name)),
matrix_as_pov_string(ob.matrix_world.inverted() @ dupmatrix),
)
# add object to a list so that it is not rendered for some instance_types
if (
Maurice Raybaud
committed
ob.instance_type not in {'COLLECTION'}
and duplidataname not in duplidata_ref
):
duplidata_ref.append(
duplidataname
Maurice Raybaud
committed
) # older key [string_strip_hyphen(bpy.path.clean_name("OB"+obj.name))]
Maurice Raybaud
committed
# obj.dupli_list_clear()# just do not store any reference to instance since 2.8
Maurice Raybaud
committed
if _dupnames_seen:
print("WARNING: Unparseable objects in current .blend file:\n''--> %s" % _dupnames_seen)
if duplidata_ref:
print("duplidata_ref = %s" % duplidata_ref)
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
for data_name, inst in data_ref.items():
for ob_name, matrix_str in inst:
if ob_name not in duplidata_ref: # .items() for a dictionary
tab_write("\n//----Blender Object Name:%s----\n" % ob_name)
if ob.pov.object_as == '':
tab_write("object { \n")
tab_write("%s\n" % data_name)
tab_write("%s\n" % matrix_str)
tab_write("}\n")
else:
no_boolean = True
for mod in ob.modifiers:
if mod.type == 'BOOLEAN':
operation = None
no_boolean = False
if mod.operation == 'INTERSECT':
operation = 'intersection'
else:
operation = mod.operation.lower()
mod_ob_name = string_strip_hyphen(
bpy.path.clean_name(mod.object.name)
)
mod_matrix = global_matrix @ mod.object.matrix_world
mod_ob_matrix = matrix_as_pov_string(mod_matrix)
tab_write("%s { \n" % operation)
tab_write("object { \n")
tab_write("%s\n" % data_name)
tab_write("%s\n" % matrix_str)
tab_write("}\n")
tab_write("object { \n")
tab_write("%s\n" % ('DATA' + mod_ob_name))
tab_write("%s\n" % mod_ob_matrix)
tab_write("}\n")
tab_write("}\n")
break
if no_boolean:
tab_write("object { \n")
tab_write("%s\n" % data_name)
tab_write("%s\n" % matrix_str)
tab_write("}\n")