Skip to content

New extension: ExtraRenderingControl #1483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions extensions/community/ExtraRenderingControl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"author": "",
"category": "Advanced",
"extensionNamespace": "",
"fullName": "ExtraRenderingControl",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZpZGVvLTNkLXZhcmlhbnQiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQsMTBWMTRBMC41LDAuNSAwIDAsMSAxMy41LDE0LjVIMTIuNVY5LjVIMTMuNUEwLjUsMC41IDAgMCwxIDE0LDEwTTIxLDYuNVYxNy41TDE3LDEzLjVWMTdBMSwxIDAgMCwxIDE2LDE4SDRBMSwxIDAgMCwxIDMsMTdWN0ExLDEgMCAwLDEgNCw2SDE2QTEsMSAwIDAsMSAxNyw3VjEwLjVNOS41LDkuNUExLjUsMS41IDAgMCwwIDgsOEg0LjVWOS41SDhWMTEuMjVINS41VjEyLjc1SDhWMTQuNUg0LjVWMTZIOEExLjUsMS41IDAgMCwwIDkuNSwxNC41TTE1LjUsOS41QTEuNSwxLjUgMCAwLDAgMTQsOEgxMVYxNkgxNEExLjUsMS41IDAgMCwwIDE1LjUsMTQuNSIgLz48L3N2Zz4=",
"name": "ExtraRenderingControl",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/6760f151bd8288f69b1628449a3984abc9ad4e056851c4dc188be579d35dee10_video-3d-variant.svg",
"shortDescription": "Gives extra control over the built-in 3D.",
"version": "0.0.1",
"description": [
"Currently you can change how the sides of 3d boxes are being rendered ",
"using ThreeJS, but im going to add more action/conditions soon"
],
"tags": [
"3d",
"rendering",
"threejs"
],
"authorIds": [
"RSeNCxLJD2N3iBVerJci9hztlNp2"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Changes the rendering mode cube's sides (Front, Back, Double).",
"fullName": "SideRendering",
"functionType": "Action",
"name": "SideRendering",
"sentence": "Change side rendering of _PARAM1_ to _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"var sideOverride = eventsFunctionContext.getArgument(\"Side\")",
"",
"objects.forEach(object => {",
" const threeObject = object.get3DRendererObject();",
" if (threeObject) {",
" for(let i = 0; i < 5; i++) {",
" threeObject.material[i].side = sideOverride;",
" }",
" threeObject.needsUpdate = true;",
" setTimeout(1)",
" } else { console.error(Error)}",
"});"
],
"parameterObjects": "Object",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "Scene3D::Cube3DObject",
"type": "objectList"
},
{
"description": "Default is 0, and it can to up to 2",
"name": "Side",
"type": "expression"
}
],
"objectGroups": []
},
{
"description": "Checks how are the faces are being rendered (Front, Back, Double).",
"fullName": "IsRenderingSide",
"functionType": "Condition",
"name": "IsRenderingSide",
"sentence": "Is _PARAM1_ rendering side _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"var sideOverride = eventsFunctionContext.getArgument(\"Side\")",
"//0 means only front, 1 means back, and 2 means its going to render both back and front",
"objects.forEach(object => {",
" const threeObject = object.get3DRendererObject();",
" if (threeObject && threeObject.material[0].side == sideOverride) { //[0] == top side of the box",
" eventsFunctionContext.returnValue = true;",
" } else { eventsFunctionContext.returnValue = false; }",
"});"
],
"parameterObjects": "Object",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "Scene3D::Cube3DObject",
"type": "objectList"
},
{
"description": "Default is 0, and it can to up to 2",
"name": "Side",
"type": "expression"
}
],
"objectGroups": []
}
],
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
}