I have a DummyNode with a child ObjectMesh, both created via System-script function NewNode(), and the pointers are managed by C++. Child was attached by Unigine::Node::addChild().
I used SetScale() from World script to set parent node scale - all was Ok.
BUT.
When I moved SetScale() to the System script, it began to set the scale BOTH to parent and child nodes.
(C++) - by switching which line, I get different sizes of objects on the scene (of size Scale or Scale^2)
...
static void SetScale(NodePtr parentNode, float scale)
{
//Engine::get()->runSystem("NodeSetScale", Variable("Node",node.get()), Variable(scale));
Engine::get()->runWorld("NodeSetScale", Variable("Node",node.get()), Variable(scale));
}
(unigine.cpp) - indeed sets Node's and Node's child scale
...
void NodeSetScale(Node node, float scale)
{
return node.setScale(vec3(scale, scale, scale));
}
(Earth.cpp) - indeed sets Node's scale only
...
void NodeSetScale(Node node, float scale)
{
return node.setScale(vec3(scale, scale, scale));
}