Skip to content

Commit

Permalink
Deploying to gh-pages from @ fury-gl/fury@ec765e8 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed May 5, 2024
1 parent 88e6420 commit 9829854
Show file tree
Hide file tree
Showing 725 changed files with 6,507 additions and 6,613 deletions.
2 changes: 1 addition & 1 deletion dev/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 2d738100674e2dc5b1e831085a0356c1
config: 85dc611463da378778771e23b742afd9
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_arrow.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_cone.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_gltf.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_morphing.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_picking.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_skinning.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_slice.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_sphere.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_spiky.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_surfaces.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_texture.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/01_introductory/viz_timers.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/collision-particles.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_advanced.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_brownian_motion.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_bundles.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_dt_ellipsoids.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_emwave_animation.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_fiber_odf.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_fractals.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_helical_motion.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_markers.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_network.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_pbr_interactive.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_play_video.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_roi_contour.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/04_demos/viz_tesseract.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_buttons.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_card.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_card_sprite_sheet.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_check_boxes.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_combobox.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_drawpanel.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_layout.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_radio_buttons.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_shapes.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_spinbox.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_tab.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_ui.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_ui_listbox.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/07_ui/viz_ui_slider.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/10_animation/viz_camera.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/10_animation/viz_timeline.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/13_shaders/viz_pbr_spheres.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/13_shaders/viz_sdf_cylinder.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/13_shaders/viz_sdfactor.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/13_shaders/viz_shader.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/17_pybullet/viz_ball_collide.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/17_pybullet/viz_brick_wall.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/17_pybullet/viz_chain.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/17_pybullet/viz_domino.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/20_stream/viz_interaction.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/20_stream/viz_no_interaction.doctree
Binary file not shown.
Binary file modified dev/.doctrees/auto_examples/20_stream/viz_widget.doctree
Binary file not shown.
Binary file modified dev/.doctrees/community.doctree
Binary file not shown.
Binary file modified dev/.doctrees/environment.pickle
Binary file not shown.
Binary file modified dev/.doctrees/reference/fury.actor.doctree
Binary file not shown.
Binary file modified dev/.doctrees/reference/fury.colormap.doctree
Binary file not shown.
Binary file modified dev/.doctrees/reference/fury.deprecator.doctree
Binary file not shown.
Binary file modified dev/.doctrees/reference/fury.gltf.doctree
Binary file not shown.
Binary file modified dev/.doctrees/reference/fury.material.doctree
Binary file not shown.
Binary file modified dev/.doctrees/reference/fury.primitive.doctree
Binary file not shown.
Binary file modified dev/.doctrees/reference/fury.transform.doctree
Binary file not shown.
Binary file modified dev/.doctrees/reference/fury.ui.doctree
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
},
"outputs": [],
"source": [
"interactive = False\n\nif interactive:\n showm.start()\n\nwindow.record(scene, out_path='viz_keyframe_animation_spline.png', size=(900, 768))"
"interactive = False\n\nif interactive:\n showm.start()\n\nwindow.record(scene, out_path=\"viz_keyframe_animation_spline.png\", size=(900, 768))"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
application will exit after the callback has been called 100 times.
"""


import itertools

import numpy as np
Expand Down Expand Up @@ -67,4 +66,4 @@ def timer_callback(_obj, _event):

showm.start()

window.record(showm.scene, size=(900, 768), out_path='viz_timer.png')
window.record(showm.scene, size=(900, 768), out_path="viz_timer.png")
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"outputs": [],
"source": [
"panel = ui.Panel2D(size=(400, 200), color=(1, 0.5, 0.0), align='right')\npanel.center = (150, 200)\n\ntext_block = ui.TextBlock2D(text='Left click on object \\n')\npanel.add_element(text_block, (0.3, 0.3))"
"panel = ui.Panel2D(size=(400, 200), color=(1, 0.5, 0.0), align=\"right\")\npanel.center = (150, 200)\n\ntext_block = ui.TextBlock2D(text=\"Left click on object \\n\")\npanel.add_element(text_block, (0.3, 0.3))"
]
},
{
Expand All @@ -51,7 +51,7 @@
},
"outputs": [],
"source": [
"scene = window.Scene()\n\nlabel_actor = actor.vector_text(text='Test')"
"scene = window.Scene()\n\nlabel_actor = actor.vector_text(text=\"Test\")"
]
},
{
Expand Down Expand Up @@ -105,7 +105,7 @@
},
"outputs": [],
"source": [
"vcolors = utils.colors_from_actor(fury_actor, 'colors')"
"vcolors = utils.colors_from_actor(fury_actor, \"colors\")"
]
},
{
Expand Down Expand Up @@ -159,7 +159,7 @@
},
"outputs": [],
"source": [
"def left_click_callback(obj, event):\n\n # Get the event position on display and pick\n\n event_pos = pickm.event_position(showm.iren)\n picked_info = pickm.pick(event_pos, showm.scene)\n\n vertex_index = picked_info['vertex']\n\n # Calculate the objects index\n\n object_index = int(np.floor((vertex_index / num_vertices) * num_objects))\n\n # Find how many vertices correspond to each object\n sec = int(num_vertices / num_objects)\n\n if not selected[object_index]:\n scale = 6 / 5\n color_add = np.array([30, 30, 30], dtype='uint8')\n selected[object_index] = True\n else:\n scale = 5 / 6\n color_add = np.array([-30, -30, -30], dtype='uint8')\n selected[object_index] = False\n\n # Update vertices positions\n vertices[object_index * sec : object_index * sec + sec] = (\n scale\n * (\n vertices[object_index * sec : object_index * sec + sec]\n - centers[object_index]\n )\n + centers[object_index]\n )\n\n # Update colors\n vcolors[object_index * sec : object_index * sec + sec] += color_add\n\n # Tell actor that memory is modified\n utils.update_actor(fury_actor)\n\n face_index = picked_info['face']\n\n # Show some info\n text = 'Object ' + str(object_index) + '\\n'\n text += 'Vertex ID ' + str(vertex_index) + '\\n'\n text += 'Face ID ' + str(face_index) + '\\n'\n text += 'World pos ' + str(np.round(picked_info['xyz'], 2)) + '\\n'\n text += 'Actor ID ' + str(id(picked_info['actor']))\n text_block.message = text\n showm.render()"
"def left_click_callback(obj, event):\n # Get the event position on display and pick\n\n event_pos = pickm.event_position(showm.iren)\n picked_info = pickm.pick(event_pos, showm.scene)\n\n vertex_index = picked_info[\"vertex\"]\n\n # Calculate the objects index\n\n object_index = int(np.floor((vertex_index / num_vertices) * num_objects))\n\n # Find how many vertices correspond to each object\n sec = int(num_vertices / num_objects)\n\n if not selected[object_index]:\n scale = 6 / 5\n color_add = np.array([30, 30, 30], dtype=\"uint8\")\n selected[object_index] = True\n else:\n scale = 5 / 6\n color_add = np.array([-30, -30, -30], dtype=\"uint8\")\n selected[object_index] = False\n\n # Update vertices positions\n vertices[object_index * sec : object_index * sec + sec] = (\n scale\n * (\n vertices[object_index * sec : object_index * sec + sec]\n - centers[object_index]\n )\n + centers[object_index]\n )\n\n # Update colors\n vcolors[object_index * sec : object_index * sec + sec] += color_add\n\n # Tell actor that memory is modified\n utils.update_actor(fury_actor)\n\n face_index = picked_info[\"face\"]\n\n # Show some info\n text = \"Object \" + str(object_index) + \"\\n\"\n text += \"Vertex ID \" + str(vertex_index) + \"\\n\"\n text += \"Face ID \" + str(face_index) + \"\\n\"\n text += \"World pos \" + str(np.round(picked_info[\"xyz\"], 2)) + \"\\n\"\n text += \"Actor ID \" + str(id(picked_info[\"actor\"]))\n text_block.message = text\n showm.render()"
]
},
{
Expand All @@ -177,7 +177,7 @@
},
"outputs": [],
"source": [
"fury_actor.AddObserver('LeftButtonPressEvent', left_click_callback, 1)"
"fury_actor.AddObserver(\"LeftButtonPressEvent\", left_click_callback, 1)"
]
},
{
Expand Down Expand Up @@ -213,7 +213,7 @@
},
"outputs": [],
"source": [
"interactive = False\n\nif interactive:\n\n showm.start()"
"interactive = False\n\nif interactive:\n showm.start()"
]
},
{
Expand All @@ -231,7 +231,7 @@
},
"outputs": [],
"source": [
"window.record(showm.scene, size=(1024, 768), out_path='viz_picking.png')"
"window.record(showm.scene, size=(1024, 768), out_path=\"viz_picking.png\")"
]
}
],
Expand Down
14 changes: 7 additions & 7 deletions dev/_downloads/04e8eda84bdca47952939ad54850e938/viz_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@
###############################################################################
# Now we create two listboxes

listbox_1 = ui.ListBox2D(size=(150, 150), values=['First', 'Second', 'Third'])
listbox_1 = ui.ListBox2D(size=(150, 150), values=["First", "Second", "Third"])

listbox_2 = ui.ListBox2D(size=(250, 250), values=['First', 'Second', 'Third'])
listbox_2 = ui.ListBox2D(size=(250, 250), values=["First", "Second", "Third"])

###############################################################################
# Now we create two different UI i.e. a slider and a listbox

slider = ui.LineSlider2D(length=150)
listbox = ui.ListBox2D(size=(150, 150), values=['First', 'Second', 'Third'])
listbox = ui.ListBox2D(size=(150, 150), values=["First", "Second", "Third"])

###############################################################################
# Now, we create grids with different shapes

rect_grid = GridLayout(position_offset=(0, 0, 0))
square_grid = GridLayout(cell_shape='square', position_offset=(0, 300, 0))
diagonal_grid = GridLayout(cell_shape='diagonal', position_offset=(0, 600, 0))
square_grid = GridLayout(cell_shape="square", position_offset=(0, 300, 0))
diagonal_grid = GridLayout(cell_shape="diagonal", position_offset=(0, 600, 0))


###############################################################################
Expand All @@ -50,7 +50,7 @@
diagonal_grid.apply([slider, listbox])

current_size = (1500, 1500)
show_manager = window.ShowManager(size=current_size, title='FURY UI Layout')
show_manager = window.ShowManager(size=current_size, title="FURY UI Layout")

show_manager.scene.add(panel_1, panel_2, listbox_1, listbox_2, slider, listbox)

Expand All @@ -60,4 +60,4 @@
if interactive:
show_manager.start()

window.record(show_manager.scene, out_path='ui_layout.png', size=(400, 400))
window.record(show_manager.scene, out_path="ui_layout.png", size=(400, 400))
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# ``Timeline`` has playback methods such as ``play``, ``pause``, ``stop``, ...
# which can be used to control the animation.


import numpy as np

from fury import actor, window
Expand Down Expand Up @@ -89,4 +88,4 @@
if interactive:
showm.start()

window.record(scene, out_path='viz_keyframe_animation_timeline.png', size=(900, 768))
window.record(scene, out_path="viz_keyframe_animation_timeline.png", size=(900, 768))
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
if interactive:
window.show(scene, size=(600, 600))

window.record(scene, out_path='viz_cone.png', size=(600, 600))
window.record(scene, out_path="viz_cone.png", size=(600, 600))
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
# values between the range 0 to 1.

material_params = [
[(1, 1, 1), {'subsurface': 0}],
[[1, 1, 0], {'metallic': 0}],
[(1, 0, 0), {'specular': 0}],
[(1, 0, 0), {'specular_tint': 0, 'specular': 1}],
[(0, 0, 1), {'roughness': 0}],
[(1, 0, 1), {'anisotropic': 0, 'metallic': 0.25, 'roughness': 0.5}],
[[0, 1, 0.5], {'sheen': 0}],
[(0, 1, 0.5), {'sheen_tint': 0, 'sheen': 1}],
[(0, 1, 1), {'clearcoat': 0}],
[(0, 1, 1), {'clearcoat_gloss': 0, 'clearcoat': 1}],
[(1, 1, 1), {"subsurface": 0}],
[[1, 1, 0], {"metallic": 0}],
[(1, 0, 0), {"specular": 0}],
[(1, 0, 0), {"specular_tint": 0, "specular": 1}],
[(0, 0, 1), {"roughness": 0}],
[(1, 0, 1), {"anisotropic": 0, "metallic": 0.25, "roughness": 0.5}],
[[0, 1, 0.5], {"sheen": 0}],
[(0, 1, 0.5), {"sheen_tint": 0, "sheen": 1}],
[(0, 1, 1), {"clearcoat": 0}],
[(0, 1, 1), {"clearcoat_gloss": 0, "clearcoat": 1}],
]

###############################################################################
Expand All @@ -68,16 +68,16 @@
# Finally, let's add some labels to guide us through our visualization.

labels = [
'Subsurface',
'Metallic',
'Specular',
'Specular Tint',
'Roughness',
'Anisotropic',
'Sheen',
'Sheen Tint',
'Clearcoat',
'Clearcoat Gloss',
"Subsurface",
"Metallic",
"Specular",
"Specular Tint",
"Roughness",
"Anisotropic",
"Sheen",
"Sheen Tint",
"Clearcoat",
"Clearcoat Gloss",
]

for i in range(10):
Expand All @@ -104,4 +104,4 @@
if interactive:
window.show(scene)

window.record(scene, size=(600, 600), out_path='viz_principled_spheres.png')
window.record(scene, size=(600, 600), out_path="viz_principled_spheres.png")
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
First some imports.
"""

import itertools

import numpy as np
Expand Down Expand Up @@ -230,7 +231,7 @@ def sync_actor(actor, multibody):

fpss = np.array([])
tb = ui.TextBlock2D(
text='Avg. FPS: \nSim Steps: ', position=(0, 680), font_size=30, color=(1, 0.5, 0)
text="Avg. FPS: \nSim Steps: ", position=(0, 680), font_size=30, color=(1, 0.5, 0)
)
scene.add(tb)

Expand Down Expand Up @@ -259,7 +260,7 @@ def timer_callback(_obj, _event):
fps = showm.frame_rate
fpss = np.append(fpss, fps)
tb.message = (
'Avg. FPS: ' + str(np.round(np.mean(fpss), 0)) + '\nSim Steps: ' + str(cnt)
"Avg. FPS: " + str(np.round(np.mean(fpss), 0)) + "\nSim Steps: " + str(cnt)
)

# Get the position and orientation of the ball.
Expand Down Expand Up @@ -299,4 +300,4 @@ def timer_callback(_obj, _event):
if interactive:
showm.start()

window.record(scene, out_path='viz_brick_wall.png', size=(900, 768))
window.record(scene, out_path="viz_brick_wall.png", size=(900, 768))
Binary file not shown.
12 changes: 6 additions & 6 deletions dev/_downloads/0815a10a49849e7a50936c253c3ffffc/viz_fractals.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def gen_centers(depth, pos, center, side):
# the Scene and ShowManager.

scene = window.Scene()
showmgr = window.ShowManager(scene, 'Fractals', (800, 800), reset_camera=True)
showmgr = window.ShowManager(scene, "Fractals", (800, 800), reset_camera=True)

###############################################################################
# These values are what work nicely on my machine without lagging. If you have
Expand All @@ -235,16 +235,16 @@ def gen_centers(depth, pos, center, side):
# fractals and add the selected one. This also resets the camera.

options = {
'Tetrix': 0,
'Sponge': 1,
'Snowflake': 2,
"Tetrix": 0,
"Sponge": 1,
"Snowflake": 2,
}

shape_chooser = ui.RadioButton(
options.keys(),
padding=10,
font_size=16,
checked_labels=['Tetrix'],
checked_labels=["Tetrix"],
position=(10, 10),
)

Expand Down Expand Up @@ -289,4 +289,4 @@ def timer_callback(_obj, _event):
if interactive:
showmgr.start()
else:
window.record(showmgr.scene, out_path='fractals.png', size=(800, 800))
window.record(showmgr.scene, out_path="fractals.png", size=(800, 800))
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
},
"outputs": [],
"source": [
"counter = itertools.count()\nfpss = np.array([])\ntb = ui.TextBlock2D(\n position=(0, 680), font_size=30, color=(1, 0.5, 0), text='Avg. FPS: \\nSim Steps: '\n)\nscene.add(tb)"
"counter = itertools.count()\nfpss = np.array([])\ntb = ui.TextBlock2D(\n position=(0, 680), font_size=30, color=(1, 0.5, 0), text=\"Avg. FPS: \\nSim Steps: \"\n)\nscene.add(tb)"
]
},
{
Expand All @@ -285,7 +285,7 @@
},
"outputs": [],
"source": [
"apply_force = True\n\n\n# Create timer callback which will execute at each step of simulation.\ndef timer_callback(_obj, _event):\n global apply_force, fpss\n cnt = next(counter)\n showm.render()\n\n if cnt % 1 == 0:\n fps = showm.frame_rate\n fpss = np.append(fpss, fps)\n tb.message = (\n 'Avg. FPS: ' + str(np.round(np.mean(fpss), 0)) + '\\nSim Steps: ' + str(cnt)\n )\n\n # Updating the position and orientation of each individual brick.\n for idx, brick in enumerate(bricks):\n sync_brick(idx, brick)\n\n pos, _ = p.getBasePositionAndOrientation(rope)\n\n if apply_force:\n p.applyExternalForce(\n rope, -1, forceObj=[-500, 0, 0], posObj=pos, flags=p.WORLD_FRAME\n )\n apply_force = False\n\n pos = p.getLinkState(rope, p.getNumJoints(rope) - 1)[4]\n ball_actor.SetPosition(*pos)\n sync_chain(rope_actor, rope)\n utils.update_actor(brick_actor)\n utils.update_actor(rope_actor)\n\n # Simulate a step.\n p.stepSimulation()\n\n if cnt == 130:\n showm.exit()\n\n\n# Add the timer callback to showmanager.\n# Increasing the duration value will slow down the simulation.\nshowm.add_timer_callback(True, 1, timer_callback)\n\ninteractive = False\n\n# start simulation\nif interactive:\n showm.start()\n\nwindow.record(scene, size=(900, 768), out_path='viz_wrecking_ball.png')"
"apply_force = True\n\n\n# Create timer callback which will execute at each step of simulation.\ndef timer_callback(_obj, _event):\n global apply_force, fpss\n cnt = next(counter)\n showm.render()\n\n if cnt % 1 == 0:\n fps = showm.frame_rate\n fpss = np.append(fpss, fps)\n tb.message = (\n \"Avg. FPS: \" + str(np.round(np.mean(fpss), 0)) + \"\\nSim Steps: \" + str(cnt)\n )\n\n # Updating the position and orientation of each individual brick.\n for idx, brick in enumerate(bricks):\n sync_brick(idx, brick)\n\n pos, _ = p.getBasePositionAndOrientation(rope)\n\n if apply_force:\n p.applyExternalForce(\n rope, -1, forceObj=[-500, 0, 0], posObj=pos, flags=p.WORLD_FRAME\n )\n apply_force = False\n\n pos = p.getLinkState(rope, p.getNumJoints(rope) - 1)[4]\n ball_actor.SetPosition(*pos)\n sync_chain(rope_actor, rope)\n utils.update_actor(brick_actor)\n utils.update_actor(rope_actor)\n\n # Simulate a step.\n p.stepSimulation()\n\n if cnt == 130:\n showm.exit()\n\n\n# Add the timer callback to showmanager.\n# Increasing the duration value will slow down the simulation.\nshowm.add_timer_callback(True, 1, timer_callback)\n\ninteractive = False\n\n# start simulation\nif interactive:\n showm.start()\n\nwindow.record(scene, size=(900, 768), out_path=\"viz_wrecking_ball.png\")"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
==============================
In this tutorial, we will show how to create a glTF file for a scene.
"""

import numpy as np

from fury import actor, gltf, window
Expand All @@ -30,8 +31,8 @@
sphere = actor.sphere(np.add(centers, np.array([0, 2, 0])), colors=colors)
scene.add(sphere)

fetch_gltf('BoxTextured', 'glTF')
filename = read_viz_gltf('BoxTextured')
fetch_gltf("BoxTextured", "glTF")
filename = read_viz_gltf("BoxTextured")
gltf_obj = gltf.glTF(filename)
box_actor = gltf_obj.actors()
scene.add(box_actor[0])
Expand All @@ -46,12 +47,12 @@
##############################################################################
# Exporting scene as a glTF file

gltf.export_scene(scene, filename='viz_gltf_export.gltf')
gltf.export_scene(scene, filename="viz_gltf_export.gltf")

##############################################################################
# Reading the newly created glTF file and get actors.

gltf_obj = gltf.glTF('viz_gltf_export.gltf')
gltf_obj = gltf.glTF("viz_gltf_export.gltf")
actors = gltf_obj.actors()

##############################################################################
Expand All @@ -64,4 +65,4 @@
if interactive:
window.show(scene, size=(1280, 720))

window.record(scene, out_path='viz_gltf_export.png', size=(1280, 720))
window.record(scene, out_path="viz_gltf_export.png", size=(1280, 720))
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
},
"outputs": [],
"source": [
"showm.add_animation(timeline)\n\nscene.set_camera(position=(0, 0, -10))\n\ninteractive = False\n\nif interactive:\n showm.start()\n\nwindow.record(scene, out_path='viz_keyframe_animation_timeline.png', size=(900, 768))"
"showm.add_animation(timeline)\n\nscene.set_camera(position=(0, 0, -10))\n\ninteractive = False\n\nif interactive:\n showm.start()\n\nwindow.record(scene, out_path=\"viz_keyframe_animation_timeline.png\", size=(900, 768))"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@

# Create a function to print a counter to the console
def print_counter():
print('')
print("")
for i in range(100):
print('\rCounter: %d' % i, end='')
print("\rCounter: %d" % i, end="")
message = "Let's count up to 100 and exit :" + str(i + 1)
tb.message = message
time.sleep(0.05)
if showm.is_done():
break
showm.exit()
print('')
print("")


# Create a function to rotate the camera
Expand Down
Loading

0 comments on commit 9829854

Please sign in to comment.