+ else:#{
+ ent_type = obj_ent_type( obj )
+
+ if ent_type == 'ent_gate':#{
+ cv_ent_gate( obj )
+ route_gates += [obj]
+ #}
+ elif ent_type == 'ent_route_node':#{
+ if obj.type == 'CURVE':#{
+ route_curves += [obj]
+ #}
+ #}
+ elif ent_type == 'ent_route':
+ routes += [obj]
+ elif ent_type == 'ent_volume':#{
+ cv_ent_volume( obj )
+ #}
+ elif ent_type == 'ent_objective':#{
+ data = obj.SR_data.ent_objective[0]
+ if data.proxima:#{
+ cv_draw_arrow( obj.location, data.proxima.location, (1,0.6,0.2) )
+ #}
+ if data.target:
+ cv_draw_arrow( obj.location, data.target.location, (1,1,1) )
+ #}
+ elif ent_type == 'ent_relay':#{
+ data = obj.SR_data.ent_relay[0]
+ if data.target0:
+ cv_draw_arrow( obj.location, data.target0.location, (1,1,1) )
+ if data.target1:
+ cv_draw_arrow( obj.location, data.target1.location, (1,1,1) )
+ if data.target2:
+ cv_draw_arrow( obj.location, data.target2.location, (1,1,1) )
+ if data.target3:
+ cv_draw_arrow( obj.location, data.target3.location, (1,1,1) )
+ #}
+ elif ent_type == 'ent_challenge':#{
+ data = obj.SR_data.ent_challenge[0]
+ if data.target:
+ cv_draw_arrow( obj.location, data.target.location, (1,1,1) )
+ if data.reset:
+ cv_draw_arrow( obj.location, data.reset.location, (0.9,0,0) )
+ if data.first:
+ cv_draw_arrow( obj.location, data.first.location, (1,0.6,0.2) )
+
+ cc1 = (0.4,0.3,0.2)
+ info_cu = Vector((1.2,0.01,0.72))*0.5
+ info_co = Vector((0.0,0.0,0.72))*0.5
+ cv_draw_ucube( obj.matrix_world, cc1, info_cu, info_co)
+ if data.camera:
+ cv_draw_line_dotted( obj.location, data.camera.location, (1,1,1))
+
+ vs = [Vector((-0.2,0.0,0.10)),Vector((-0.2,0.0,0.62)),\
+ Vector(( 0.2,0.0,0.62)),Vector((-0.2,0.0,0.30)),\
+ Vector(( 0.1,0.0,0.30))]
+ for v in range(len(vs)):#{
+ vs[v] = obj.matrix_world @ vs[v]
+ #}
+
+ cv_view_verts += [vs[0],vs[1],vs[1],vs[2],vs[3],vs[4]]
+ cv_view_colours += [cc1,cc1,cc1,cc1,cc1,cc1]
+ #}
+ elif ent_type == 'ent_audio':#{
+ if obj.SR_data.ent_audio[0].flag_3d:
+ cv_draw_sphere( obj.location, obj.scale[0], (1,1,0) )
+ #}
+ elif ent_type == 'ent_font':#{
+ data = obj.SR_data.ent_font[0]
+
+ for i in range(len(data.variants)):#{
+ sub = data.variants[i].mesh
+ if not sub: continue
+
+ for ch in data.glyphs:#{
+ mini = (ch.bounds[0],ch.bounds[1])
+ maxi = (ch.bounds[2]+mini[0],ch.bounds[3]+mini[1])
+ p0 = sub.matrix_world @ Vector((mini[0],0.0,mini[1]))
+ p1 = sub.matrix_world @ Vector((maxi[0],0.0,mini[1]))
+ p2 = sub.matrix_world @ Vector((maxi[0],0.0,maxi[1]))
+ p3 = sub.matrix_world @ Vector((mini[0],0.0,maxi[1]))
+
+ if i == data.variants_index: cc = (0.5,0.5,0.5)
+ else: cc = (0,0,0)
+
+ cv_view_verts += [p0,p1,p1,p2,p2,p3,p3,p0]
+ cv_view_colours += [cc,cc,cc,cc,cc,cc,cc,cc]
+ #}
+ #}
+ #}
+ elif ent_type == 'ent_skateshop':#{
+ data = obj.SR_data.ent_skateshop[0]
+ display = data.mark_display
+ info = data.mark_info
+
+ if data.tipo == '0':#{
+ cc = (0.0,0.9,0.6)
+ cc1 = (0.4,0.9,0.2)
+ cc2 = (0.9,0.6,0.1)
+
+ rack = data.mark_rack
+
+ rack_cu = Vector((3.15,2.0,0.1))*0.5
+ rack_co = Vector((0.0,0.0,0.0))
+ display_cu = Vector((0.3,1.2,0.1))*0.5
+ display_co = Vector((0.0,0.0,0.1))*0.5
+ info_cu = Vector((1.2,0.01,0.3))*0.5
+ info_co = Vector((0.0,0.0,0.0))*0.5
+ #}
+ elif data.tipo == '1':#{
+ rack = None
+ cc1 = (1.0,0.0,0.0)
+ cc2 = (1.0,0.5,0.0)
+ display_cu = Vector((0.4,0.4,2.0))*0.5
+ display_co = Vector((0.0,0.0,1.0))*0.5
+ info_cu = Vector((1.2,0.01,0.3))*0.5
+ info_co = Vector((0.0,0.0,0.0))*0.5
+ #}
+ elif data.tipo == '2':#{
+ rack = None
+ cc1 = (1.0,0.0,0.0)
+ cc2 = (1.0,0.5,0.0)
+ display_cu = Vector((1.0,1.0,0.5))*0.5
+ display_co = Vector((0.0,0.0,0.5))*0.5
+ info_cu = Vector((1.2,0.01,0.3))*0.5
+ info_co = Vector((0.0,0.0,0.0))*0.5
+ #}
+ elif data.tipo == '3':#{
+ rack = None
+ display = None
+ info = None
+ #}
+
+ if rack:
+ cv_draw_ucube( rack.matrix_world, cc, rack_cu, rack_co )
+ if display:
+ cv_draw_ucube( display.matrix_world, cc1, display_cu, display_co)
+ if info:
+ cv_draw_ucube( info.matrix_world, cc2, info_cu, info_co )
+ #}
+ elif ent_type == 'ent_swspreview':#{
+ cc1 = (0.4,0.9,0.2)
+ data = obj.SR_data.ent_swspreview[0]
+ display = data.mark_display
+ display1 = data.mark_display1
+ display_cu = Vector((0.3,1.2,0.1))*0.5
+ display_co = Vector((0.0,0.0,0.1))*0.5
+ if display:
+ cv_draw_ucube( display.matrix_world, cc1, display_cu, display_co)
+ if display1:
+ cv_draw_ucube(display1.matrix_world, cc1, display_cu, display_co)
+ #}
+ elif ent_type == 'ent_menuitem':#{
+ for i,col in enumerate(obj.users_collection):#{
+ colour32 = hash_djb2( col.name )
+ r = pow(((colour32 ) & 0xff) / 255.0, 2.2 )
+ g = pow(((colour32>>8 ) & 0xff) / 255.0, 2.2 )
+ b = pow(((colour32>>16) & 0xff) / 255.0, 2.2 )
+ cc = (r,g,b)
+ vs = [None for _ in range(8)]
+ scale = i*0.02
+ for j in range(8):#{
+ v0 = Vector([(obj.bound_box[j][z]+\
+ ((-1.0 if obj.bound_box[j][z]<0.0 else 1.0)*scale)) \
+ for z in range(3)])
+ vs[j] = obj.matrix_world @ v0
+ #}
+ indices = [(0,1),(1,2),(2,3),(3,0),(4,5),(5,6),(6,7),(7,4),\
+ (0,4),(1,5),(2,6),(3,7)]
+ for l in indices:#{
+ v0 = vs[l[0]]
+ v1 = vs[l[1]]
+ cv_view_verts += [(v0[0],v0[1],v0[2])]
+ cv_view_verts += [(v1[0],v1[1],v1[2])]
+ cv_view_colours += [cc,cc]
+ #}
+ #}
+ cv_draw_lines()
+ cc = (1.0,1.0,1.0)
+ data = obj.SR_data.ent_menuitem[0]
+ if data.tipo == '4':#{
+ if data.slider_minloc and data.slider_maxloc:#{
+ v0 = data.slider_minloc.location
+ v1 = data.slider_maxloc.location
+ cv_draw_line( v0, v1, cc )
+ #}
+ #}
+
+ colour32 = hash_djb2(obj.name)
+ r = ((colour32 ) & 0xff) / 255.0
+ g = ((colour32>>8 ) & 0xff) / 255.0
+ b = ((colour32>>16) & 0xff) / 255.0
+ cc = (r,g,b)
+ origin = obj.location + (Vector((r,g,b))*2.0-Vector((1.0,1.0,1.0)))\
+ * 0.04
+
+ size = 0.01
+
+ if data.tipo != '0':#{
+ if data.tipo == '4':#{
+ if data.link0:#{
+ cv_draw_arrow( origin, data.link0.location, cc, size )
+ #}
+ if data.link1:#{
+ cv_draw_arrow( origin, data.link1.location, cc, size )
+ #}
+ #}
+ else:#{
+ if data.link0:#{
+ cv_draw_arrow( origin, data.link0.location, cc, size )
+ #}
+ if data.link1:#{
+ cv_draw_arrow( origin, data.link1.location, cc, size )
+ #}
+ if data.link2:#{
+ cv_draw_arrow( origin, data.link2.location, cc, size )
+ #}
+ if data.link3:#{
+ cv_draw_arrow( origin, data.link3.location, cc, size )
+ #}
+ #}
+ #}
+ #}