ambiera home ambiera home

Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:    
Ambiera Forum > CopperCube > Programming and Scripting
Replace a scene node with a different scene node "help"
Author Text

ori
Registered User
Quote
2018-09-14 17:15:14

Hi! is someone able to help with making a new action that "replaces a scene node with a different scene node"... Example "ActionOnDie" replace the current mesh or billboard/scene node with a totally different mesh or billboard/scene node.... I guess similar to Hide or unhide a scene node but instead of hiding the scene node it is being replaced by another scene node.

Cheers.


tim12345
Guest
Quote
2018-09-14 19:27:15

this can already be done in the editor by simply deleting the scene node and changing the position or cloning and changing the position of desired scene node simultaneously. but you are wanting a javascript action for this?


ori
Registered User
Quote
2018-09-15 02:48:56

Hi! thanks for the reply! i'm aware that what i'm asking can be achieved in this manner, though the end result is a lot of busy work. If the effect was a scripted action "replace a scene node with a different scene node" it would eliminate this busy work and make work flow faster! particularly if a project has several scene nodes that need to be changed each to a completely different scene node...


tim12345
Guest
Quote
2018-09-15 08:12:17

ah I see. well then you will probably want to create a .js file named action_replace.js and then add something like this to it...

/*  <action jsname="action_replace" description="Replace current scene node with a different scene node">
<property name="ReplacementNode" type="scenenode" />
</action>
*/
action_replace = function()
{
};
action_replace.prototype.execute = function(currentNode)
{
var curPos = ccbGetSceneNodeProperty(currentNode, "Position");
var sourceNode = this.ReplacementNode;
var newscenenode = ccbCloneSceneNode(sourceNode);
ccbSetSceneNodeProperty(newscenenode, "Name", "replacer");
ccbSetSceneNodeProperty(newscenenode, "Visible", true);
ccbSetSceneNodeProperty(newscenenode,"Position",curPos);
ccbRemoveSceneNode(currentNode);
};



ori
Registered User
Quote
2018-09-15 15:25:10

Thank you so much! i really appreciate that you took the time to do this, the script works like a charm...


mazenn
Registered User
Quote
2018-09-24 23:05:36

Not sure what you want but, you can re-parent any child node through the rmb and you can "change node type" even of the root node, copy params from any node, and post it in there.

Less than ideal, but see the issue for further clarifications.https://googlehangouts.ooo/ https://8ballpool.onl/ https://omegle.onl/


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inter?ational" (you are not logged in)


Text:

 

  

Forum Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   





Software: Ambiera Light Forum. © 2008-2018 Nikolaus Gebhardt, Ambiera e.U.