mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
more changes
This commit is contained in:
1 parent
648e942441
commit
e8d4d92c01
2 files changed
+15
-15
No files matched your search
@@ -26,21 +26,19 @@ export const TrackProvider = ({ children }: Props) => {
|
||||
|
||||
// cross group functions
|
||||
const dropClip = useCallback(() => {
|
||||
|
||||
|
||||
console.log(`${JSON.stringify(dragItem)}`)
|
||||
console.log(`${JSON.stringify(dragItem)}`);
|
||||
|
||||
if (dragItem.value != null && dragItem != null) {
|
||||
// should be able to drag into the timeline ... TODO FIX?
|
||||
|
||||
if (dragItem.value.type === AssetType.CHARACTER) {
|
||||
addCharacter(dragItem.value)
|
||||
addCharacter(dragItem.value);
|
||||
}
|
||||
// if (dragItem.value.type === AssetType.CAMERA) {
|
||||
// console.log("Dragged In Camera Type")
|
||||
// }
|
||||
if (dragItem.value.type === AssetType.OBJECT) {
|
||||
addObject(dragItem.value)
|
||||
addObject(dragItem.value);
|
||||
}
|
||||
}
|
||||
// if (dragItem.value.type === AssetType.SHAPE) {
|
||||
@@ -56,6 +54,7 @@ export const TrackProvider = ({ children }: Props) => {
|
||||
});
|
||||
}
|
||||
if (dragItem.value.type === AssetType.AUDIO) {
|
||||
console.log("add audio", dropId.value);
|
||||
addCharacterAudio({
|
||||
dragItem: dragItem.value!,
|
||||
characterId: dropId.value,
|
||||
|
||||
@@ -173,6 +173,13 @@ export function addCharacterAudio({
|
||||
if (character.id !== characterId) {
|
||||
return { ...character };
|
||||
}
|
||||
|
||||
Queue.publish({
|
||||
queueName: QueueNames.TO_ENGINE,
|
||||
action: toEngineActions.ADD_CLIP,
|
||||
data: newClip,
|
||||
});
|
||||
|
||||
return {
|
||||
...character,
|
||||
lipSyncClips: [...character.lipSyncClips, newClip].sort(
|
||||
@@ -180,12 +187,6 @@ export function addCharacterAudio({
|
||||
),
|
||||
};
|
||||
});
|
||||
|
||||
Queue.publish({
|
||||
queueName: QueueNames.TO_ENGINE,
|
||||
action: toEngineActions.ADD_CLIP,
|
||||
data: newClip,
|
||||
});
|
||||
}
|
||||
|
||||
export function addCharacterKeyframe(keyframe: QueueKeyframe, offset: number) {
|
||||
@@ -327,7 +328,7 @@ export function deleteCharacterKeyframe(keyframe: Keyframe) {
|
||||
}
|
||||
|
||||
// probably not to much to send imo
|
||||
export function addCharacter(character:MediaItem) {
|
||||
export function addCharacter(character: MediaItem) {
|
||||
//{"version":1,"media_id":"m_r7w1tmkx2jg8nznr3hyzj4k6zhfh7d ",
|
||||
// "type":"character","name":"Female Doll",
|
||||
// "thumbnail":"resources/characters/img03.png"}
|
||||
@@ -337,8 +338,8 @@ export function addCharacter(character:MediaItem) {
|
||||
data: character,
|
||||
});
|
||||
}
|
||||
export function addObject(object:MediaItem) {
|
||||
//{"version":1,"media_id":"m_r7w1tmkx2jg8nznr3hyzj4k6zhfh7d ",
|
||||
export function addObject(object: MediaItem) {
|
||||
//{"version":1,"media_id":"m_r7w1tmkx2jg8nznr3hyzj4k6zhfh7d ",
|
||||
// "type":"character","name":"Female Doll",
|
||||
// "thumbnail":"resources/characters/img03.png"}
|
||||
Queue.publish({
|
||||
@@ -346,4 +347,4 @@ export function addObject(object:MediaItem) {
|
||||
action: toEngineActions.ADD_OBJECT,
|
||||
data: object,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user