Skip to content

Instantly share code, notes, and snippets.

@tatmos
Created November 5, 2021 05:37
Show Gist options
  • Save tatmos/86886f94183857fabb1a38fcf314fea9 to your computer and use it in GitHub Desktop.
Save tatmos/86886f94183857fabb1a38fcf314fea9 to your computer and use it in GitHub Desktop.
[tatmos][Create]選択したキューを止めるキューを作る ADX2ロボット
# --Description:[tatmos][Create]選択したキューを止めるキューを作る
import cri.atomcraft.debug as acdebug
import cri.atomcraft.project as acproject
# 選択しているCueを得る
selected_Cues = acproject.get_selected_objects("Cue")["data"]
if not selected_Cues :
acdebug.warning("Please select at least a Cue.")
sys.exit()
for cue in selected_Cues:
cue_name = acproject.get_value(cue, "Name")["data"]
parentCueFolder = acproject.get_parent(cue, "CueFolder")["data"]
acdebug.log("Create {0}".format(cue_name))
if not cue:
acdebug.warning("Could not create the Cue.")
sys.exit()
if not parentCueFolder:
acdebug.warning("not found the parentCueFolder.")
sys.exit()
newCueName = cue_name+"E"
acdebug.log("Create {0}".format(newCueName))
result = acproject.create_object(parentCueFolder, "Cue", newCueName)
if result [ "succeed" ]:
newCue = result["data"]
newActionTrack = acproject.create_object(newCue, "ActionTrack", cue_name)["data"]
acproject.set_value(newActionTrack, "TargetObject", cue)
acproject.create_object(newActionTrack, "ActionStop", "Stop"+cue_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment