Ejemplo n.º 1
0
                            rotation_vector=(1, 0, 0),
                            rotation_angle=int(360 / theta_div)
                        ),
                    ),
                    duration=1
                )
            ) for i in range(theta_div)
        ]
    )

    my_project["objects"].append(my_object)

absolute_actions.append(
    (
        2 * (theta_div + 1), actions.TimelineAction(
            timeline_name="relative",
            change="Start"
        )
    )
)

absolute_timeline = timeline.W3DTimeline(
    name="absolute",
    start_immediately=True,
    actions=absolute_actions
)
my_project["timelines"].append(absolute_timeline)

relative_actions.append(
    (
        2 * theta_div, actions.TimelineAction(
            timeline_name="absolute",
Ejemplo n.º 2
0
         duration=1,
     )) for i in range(len(ordered_names))
])

relative_actions.extend([
    (4,
     actions.ObjectAction(
         object_name=ordered_names[i],
         placement=relative_placement_dic[ordered_names[i]],
         move_relative=True,
         duration=1,
     )) for i in range(len(ordered_names))
])

absolute_actions.append((2 * (len(ordered_names) + 1),
                         actions.TimelineAction(timeline_name="relative",
                                                change="Start")))

absolute_timeline = timeline.W3DTimeline(name="absolute",
                                         start_immediately=True,
                                         actions=absolute_actions)
my_project["timelines"].append(absolute_timeline)

relative_actions.append(
    (5, actions.TimelineAction(timeline_name="absolute", change="Start")))

relative_timeline = timeline.W3DTimeline(name="relative",
                                         start_immediately=False,
                                         actions=relative_actions)
my_project["timelines"].append(relative_timeline)

my_project["debug"] = True
Ejemplo n.º 3
0
# Next, let's create a clickable object to start the timeline
my_object = objects.W3DObject(
    name="button",  # Give it a name
    color=(255, 0, 0),  # Make it red
    placement=placement.W3DPlacement(  # Specify position and orientation
        position=(0, 1, 0),  # We'll leave rotation as default for now
    ),
    content=objects.W3DText(  # Specify that this is a text object
        text="Play"  # ...with text reading "Hello, World!"
    ),
    link=objects.W3DLink(  # Add a clickable link to the text object
        actions={
            0: [  # On first click (index 0)...
                actions.TimelineAction(  # start the timeline
                    timeline_name="my_timeline", change="Start"
                )
            ]
        }
    )
)

# Now add this object to the project
my_project["objects"].append(my_object)
my_project["debug"] = True

# Finally, we render the whole thing using Blender, export it, and display the
# result
export_to_blender(my_project,
                  filename="timeline_sound_sample.blend",
                  display=True)
Ejemplo n.º 4
0
                                              speed=1,
                                              particle_actions="my_actions"),
                      visible=False))

visibility_actions = [
    (0, actions.ObjectAction(
        object_name="system",
        visible=True,
        duration=5,
    )),
    (10, actions.ObjectAction(
        object_name="system",
        visible=False,
        duration=5,
    )),
    (16, actions.TimelineAction(timeline_name="visify", change="Start")),
]
vis_timeline = timeline.W3DTimeline(name="visify",
                                    start_immediately=True,
                                    actions=visibility_actions)

my_project["timelines"].append(vis_timeline)

my_project["debug"] = True

my_project.save_XML("psys_sample.xml")

# Finally, we render the whole thing using Blender, export it, and display the
# result
export_to_blender(my_project, filename="psys_sample.blend", display=True)