mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 15:13:26 +00:00
Update addon and modify example animation
This commit is contained in:
@@ -8,13 +8,13 @@ from bpy.types import Operator
|
||||
from bpy.props import StringProperty, BoolProperty, FloatProperty, IntProperty
|
||||
|
||||
bl_info = {
|
||||
"name": "Export > CSV Drone Swarm Animation Exporter (.csv)",
|
||||
"author": "Artem Vasiunik",
|
||||
"version": (0, 4, 0),
|
||||
"name": "clever-show animation (.csv)",
|
||||
"author": "Artem Vasiunik & Arthur Golubtsov",
|
||||
"version": (0, 5, 0),
|
||||
"blender": (2, 80, 0),
|
||||
#"api": 36079,
|
||||
"location": "File > Export > CSV Drone Swarm Animation Exporter (.csv)",
|
||||
"description": "Export > CSV Drone Swarm Animation Exporter (.csv)",
|
||||
"location": "File > Export > clever-show animation (.csv)",
|
||||
"description": "Export > clever-show animation (.csv)",
|
||||
"warning": "",
|
||||
"wiki_url": "https://github.com/CopterExpress/clever-show/blob/master/blender-addon/README.md",
|
||||
"tracker_url": "https://github.com/CopterExpress/clever-show/issues",
|
||||
@@ -23,20 +23,20 @@ bl_info = {
|
||||
|
||||
|
||||
class ExportCsv(Operator, ExportHelper):
|
||||
bl_idname = "export_swarm_anim.folder"
|
||||
bl_label = "Export Drone Swarm animation"
|
||||
bl_idname = "export_animation.folder"
|
||||
bl_label = "Export clever-show animation"
|
||||
filename_ext = ''
|
||||
use_filter_folder = True
|
||||
|
||||
use_namefilter: bpy.props.BoolProperty(
|
||||
name="Use name filter for objects",
|
||||
default=True,
|
||||
default=False,
|
||||
)
|
||||
|
||||
drones_name: bpy.props.StringProperty(
|
||||
name="Name identifier",
|
||||
description="Name identifier for all drone objects",
|
||||
default="copter"
|
||||
default="clever"
|
||||
)
|
||||
|
||||
show_warnings: bpy.props.BoolProperty(
|
||||
@@ -61,7 +61,7 @@ class ExportCsv(Operator, ExportHelper):
|
||||
|
||||
filepath: StringProperty(
|
||||
name="File Path",
|
||||
description="File path used for exporting CSV files",
|
||||
description="File path used for exporting csv files",
|
||||
maxlen=1024,
|
||||
subtype='DIR_PATH',
|
||||
default=""
|
||||
@@ -96,11 +96,11 @@ class ExportCsv(Operator, ExportHelper):
|
||||
distance_exeeded = False
|
||||
|
||||
prev_x, prev_y, prev_z = 0, 0, 0
|
||||
|
||||
|
||||
animation_file_writer.writerow([
|
||||
os.path.splitext(bpy.path.basename(bpy.data.filepath))[0]
|
||||
])
|
||||
|
||||
|
||||
for frame_number in range(frame_start, frame_end + 1):
|
||||
scene.frame_set(frame_number)
|
||||
rgb = get_rgb_from_object(drone_obj)
|
||||
@@ -135,9 +135,7 @@ class ExportCsv(Operator, ExportHelper):
|
||||
round(rot_z, 5),
|
||||
*rgb,
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
||||
if speed_exeeded:
|
||||
self.report({'WARNING'}, "Drone '%s' speed limits exeeded" % drone_obj.name)
|
||||
if distance_exeeded:
|
||||
@@ -195,7 +193,7 @@ def calc_distance(start_point, end_point):
|
||||
def menu_func(self, context):
|
||||
self.layout.operator(
|
||||
ExportCsv.bl_idname,
|
||||
text="CSV Drone Swarm Animation Exporter (.csv)"
|
||||
text="clever-show animation (.csv)"
|
||||
)
|
||||
|
||||
|
||||
|
||||
BIN
blender-addon/examples/basic.blend
Normal file
BIN
blender-addon/examples/basic.blend
Normal file
Binary file not shown.
51
blender-addon/examples/basic/clever-1.csv
Normal file
51
blender-addon/examples/basic/clever-1.csv
Normal file
@@ -0,0 +1,51 @@
|
||||
basic
|
||||
1,0.0,0.0,0.0,0.0,204,2,0
|
||||
2,0.0,0.0,0.0,0.0,204,9,1
|
||||
3,0.0,0.0,0.0,0.0,204,21,2
|
||||
4,0.0,0.0,0.0,0.0,204,37,3
|
||||
5,0.0,0.0,0.0,0.0,204,56,4
|
||||
6,0.0,0.0,0.0,0.0,204,77,5
|
||||
7,0.0,0.0,0.0,0.0,204,97,6
|
||||
8,0.0,0.0,0.0,0.0,204,116,6
|
||||
9,0.0,0.0,0.0,0.0,204,131,7
|
||||
10,0.0,0.0,0.0,0.0,204,143,7
|
||||
11,0.0,0.0,0.1,0.0,199,153,7
|
||||
12,0.0,0.0,0.2,0.0,185,163,6
|
||||
13,0.0,0.0,0.3,0.0,163,172,6
|
||||
14,0.0,0.0,0.4,0.0,134,181,5
|
||||
15,0.0,0.0,0.5,0.0,102,188,5
|
||||
16,0.0,0.0,0.6,0.0,69,194,4
|
||||
17,0.0,0.0,0.7,0.0,40,199,3
|
||||
18,0.0,0.0,0.8,0.0,18,201,3
|
||||
19,0.0,0.0,0.9,0.0,4,203,2
|
||||
20,0.0,0.0,1.0,0.0,0,204,2
|
||||
21,0.02217,0.0,1.0,0.0,0,204,2
|
||||
22,0.08889,0.0,1.0,0.0,0,204,2
|
||||
23,0.19737,0.0,1.0,0.0,0,204,2
|
||||
24,0.33926,0.0,1.0,0.0,0,204,2
|
||||
25,0.5,0.0,1.0,0.0,0,204,2
|
||||
26,0.66074,0.0,1.0,0.0,0,204,2
|
||||
27,0.80263,0.0,1.0,0.0,0,204,2
|
||||
28,0.91111,0.0,1.0,0.0,0,204,2
|
||||
29,0.97783,0.0,1.0,0.0,0,204,2
|
||||
30,1.0,0.0,1.0,0.0,0,204,2
|
||||
31,1.0,0.0,0.9,0.0,3,204,2
|
||||
32,1.0,0.0,0.8,0.0,14,204,2
|
||||
33,1.0,0.0,0.7,0.0,32,204,2
|
||||
34,1.0,0.0,0.6,0.0,56,204,1
|
||||
35,1.0,0.0,0.5,0.0,84,204,1
|
||||
36,1.0,0.0,0.4,0.0,112,204,0
|
||||
37,1.0,0.0,0.3,0.0,138,204,0
|
||||
38,1.0,0.0,0.2,0.0,159,204,0
|
||||
39,1.0,0.0,0.1,0.0,175,204,0
|
||||
40,1.0,0.0,0.0,0.0,183,204,0
|
||||
41,1.0,0.0,0.0,0.0,188,199,0
|
||||
42,1.0,0.0,0.0,0.0,192,185,0
|
||||
43,1.0,0.0,0.0,0.0,196,163,0
|
||||
44,1.0,0.0,0.0,0.0,199,135,0
|
||||
45,1.0,0.0,0.0,0.0,201,102,0
|
||||
46,1.0,0.0,0.0,0.0,202,69,0
|
||||
47,1.0,0.0,0.0,0.0,203,40,0
|
||||
48,1.0,0.0,0.0,0.0,203,18,0
|
||||
49,1.0,0.0,0.0,0.0,203,5,0
|
||||
50,1.0,0.0,0.0,0.0,204,0,0
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user