Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:pandrr/cables into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
pandrr committed Oct 31, 2023
2 parents 5e6811e + 7e092c7 commit 507b1aa
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const
update = op.inTrigger("Update"),
inObj = op.inObject("Object"),
next = op.outTrigger("Next");

update.onTriggered = () =>
{
if (op.patch.frameStore.compArray && op.patch.frameStore.compArray.length > 0)
{
let arr = op.patch.frameStore.compArray[op.patch.frameStore.compArray.length - 1];

try
{
arr.push(JSON.parse(JSON.stringify(inObj.get())));
}
catch (e)
{
op.log("error comparraupusharray");
}
}
next.trigger();
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"id": "761d75d3-aaae-49ba-8df1-20d8012fb70a",
"changelog": [
{
"message": "created op",
"author": "pandur",
"date": 1680619062207
},
{
"message": "Ops.Patch.PqYKyct.CreateArrayPushArray renamed to Ops.Team.CreateOps.Dev.CreateArrayPushArray",
"type": "rename",
"author": "pandur",
"date": 1680619193888
},
{
"message": "Ops.Team.CreateOps.Dev.CreateArrayPushArray renamed to Ops.Team.CreateOps.Dev.Dev.CompArrayPushArray",
"type": "rename",
"author": "pandur",
"date": 1680626244837
},
{
"message": "Ops.Team.CreateOps.Dev.Dev.CompArrayPushArray renamed to Ops.Team.CompOps.Dev.CompArrayPushArray",
"type": "rename",
"author": "pandur",
"date": 1680626323479
},
{
"message": "Ops.Team.CompOps.Dev.CompArrayPushArray renamed to Ops.Team.CompOps.CompArrayPushArray",
"type": "rename",
"author": "pandur",
"date": 1686661231934
},
{
"message": "Ops.Team.CompOps.CompArrayPushArray renamed to Ops.Data.Compose.CompArrayPushArray",
"type": "rename",
"author": "pandur",
"date": 1687167241210
},
{
"message": "cloned op from Ops.Data.Compose.CompArrayPushArray",
"author": "pandur",
"date": 1698418579461
},
{
"message": "Ops.Patch.Prb8ENJ.CompArrayPushObject renamed to Ops.Data.Compose.CompArrayPushObject",
"type": "rename",
"author": "pandur",
"date": 1698418841485
}
],
"layout": {
"portsIn": [
{
"type": 1,
"name": "Update"
},
{
"type": 2,
"name": "Object"
}
],
"portsOut": [
{
"type": 1,
"name": "Next"
}
]
},
"authorName": "pandur",
"created": 1698418579461,
"summary": "push/append an array to an array",
"collections": null,
"relatedops": null,
"docs": {
"ports": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ inSize.onChange = () => { return sizeChanged = true; };

let fb = null;

inFp.onChange = createFb;
inFp.onChange = createFbLater;

let emptyCubemap = null;
let recreateFb = true;

createFb();
function createFbLater()
{
recreateFb = true;
}

function createFb()
{
Expand All @@ -32,6 +36,7 @@ function createFb()

inTrigger.onTriggered = function ()
{
if (recreateFb)createFb();
if (sizeChanged)
{
if (fb) fb.setSize(Number(inSize.get()), Number(inSize.get()));
Expand Down
38 changes: 17 additions & 21 deletions src/ops/base/Ops.Gl.GLTF.GltfScene/Ops.Gl.GLTF.GltfScene.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,88 +22,84 @@
"layout": {
"portsIn": [
{
"type": "5",
"name": "data"
},
{
"type": "1",
"type": 1,
"name": "Render"
},
{
"type": "5",
"type": 5,
"name": "glb File"
},
{
"type": "0",
"type": 0,
"name": "Draw",
"subType": "boolean"
},
{
"type": "0",
"type": 0,
"name": "Auto Scale",
"subType": "boolean"
},
{
"type": "1",
"type": 1,
"name": "Show Structure"
},
{
"type": "0",
"type": 0,
"name": "Time",
"group": "Timing",
"subType": "number"
},
{
"type": "0",
"type": 0,
"name": "Sync to timeline",
"group": "Timing",
"subType": "boolean"
},
{
"type": "0",
"type": 0,
"name": "Loop",
"group": "Timing",
"subType": "boolean"
},
{
"type": "2",
"type": 2,
"name": "Materials"
}
],
"portsOut": [
{
"type": "1",
"type": 1,
"name": "Render Before"
},
{
"type": "1",
"type": 1,
"name": "Next"
},
{
"type": "5",
"type": 5,
"name": "Generator"
},
{
"type": "0",
"type": 0,
"name": "GLTF Version",
"subType": "number"
},
{
"type": "0",
"type": 0,
"name": "Anim Length",
"subType": "number"
},
{
"type": "0",
"type": 0,
"name": "Anim Time",
"subType": "number"
},
{
"type": "2",
"type": 2,
"name": "Json"
},
{
"type": "1",
"type": 1,
"name": "Finished"
}
]
Expand Down
10 changes: 2 additions & 8 deletions src/ops/base/Ops.Gl.GLTF.GltfScene/att_inc_gltf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const Gltf = class
}
};


function readChunk(dv, bArr, arrayBuffer, offset)
{
const chunk = {};
Expand Down Expand Up @@ -61,7 +60,6 @@ function readChunk(dv, bArr, arrayBuffer, offset)

function loadAnims(gltf)
{
let k = 0;
for (let i = 0; i < gltf.json.animations.length; i++)
{
const an = gltf.json.animations[i];
Expand All @@ -86,7 +84,7 @@ function loadAnims(gltf)

const anims = [];

for (k = 0; k < numComps; k++) anims.push(CABLES.Anim());
for (let k = 0; k < numComps; k++) anims.push(new CABLES.Anim());

if (sampler.interpolation == "LINEAR") {}
else if (sampler.interpolation == "STEP") for (k = 0; k < numComps; k++) anims[k].defaultEasing = CONSTANTS.ANIM.EASING_ABSOLUTE;
Expand All @@ -96,7 +94,7 @@ function loadAnims(gltf)
{
maxTime = Math.max(bufferIn[j], maxTime);

for (k = 0; k < numComps; k++)
for (let k = 0; k < numComps; k++)
{
anims[k].setValue(bufferIn[j], bufferOut[j * numComps + k]);
}
Expand Down Expand Up @@ -150,7 +148,6 @@ function parseGltf(arrayBuffer)

gltf.timing.push("Parse buffers", Math.round((performance.now() - gltf.startTime)));


if (views)
{
for (i = 0; i < accessors.length; i++)
Expand All @@ -170,7 +167,6 @@ function parseGltf(arrayBuffer)
let stride = view.byteStride || 0;
let dataBuff = null;


// 5120 (BYTE) 1
// 5121(UNSIGNED_BYTE) 1
// 5122 (SHORT) 2
Expand Down Expand Up @@ -221,7 +217,6 @@ function parseGltf(arrayBuffer)

gltf.timing.push("Parse nodes", Math.round((performance.now() - gltf.startTime)));


for (i = 0; i < gltf.json.nodes.length; i++)
{
const node = new gltfNode(gltf.json.nodes[i], gltf);
Expand All @@ -238,6 +233,5 @@ function parseGltf(arrayBuffer)

gltf.timing.push("finished", Math.round((performance.now() - gltf.startTime)));


return gltf;
}

0 comments on commit 507b1aa

Please sign in to comment.