Moving feature from example blend file into another project not working - Sun Position

I’m attempting to get the functionality from the ‘sun direction’ example into my project -

What are the recommended steps for this, it seems the key assets are the Empty and the Light source, I removed the ‘plane’ and the ‘cone’ objects, as they are not required for the feature to work.

I understand MyTrait is linked to the scene

and SimpleRotateObject is linked to the Empty

Within my new project blend file I’m trying to use Blenders Append and bring in the Empty and Light source from the example blend file.

It also seems like the .hx files need to be in a ‘Sources’ folder within same folder as the blend file, so that they are available to choose in Armory Traits picker
image

But it does not seem to work when I carry out all of the above - key presses do not move the position of the sun as per config in SimpleRotateObject.hx. is there a completly different way of doing this?

I simply dragged and dropped the blend file from which I wanted to take the objects, an then chose Append
Append
And the went into one of those folders and chose the object I want to import,


objects successfully import but I don’t know if they are working correctly

is this exactly the thing you have done too?

I have imported animated Bot from ‘animation blend’ project and it works perfectly :relaxed:

Yes Musa that is what I tried, but I wanted to bring in the minimum of assets from example file. so only appended the Empty and the Light. However key presses does nothing and won’t rotate the sun.

I think the keys listed in - SimpleRotateObject.hx are:
R,T
F,G
V,B

What do you typically append from the example file?

I imported objects that are located in the object folder only and it works on RT,FG,VB. After I deleted the plane and the cone from the scene it still works

I imported only empty from the object folder and set the cube as a child to this empty and the cube rotates.:slightly_smiling_face:

ok good to hear it worked for you, why is it being so stubborn for me :frowning:

What did you do with the sources folder - so that the SimpleRotateObject.hx and MyTrait.hx are located near your new .blend file?

I created a new project and saved it to a blend file so I can launch the game. I dragged and dropped the blend file from ‘worldSunDirection’ folder. Then I chose Append. then I opened the object folder and imported Empty, I attached cube to it and launched the game.

well what the hell - it seems because I was trying to match the setup of the example sun file - by adding MyTrait to the scene Traits - that caused it to fail, as soon as I removed it things work fine
image

Not sure why it does not like that being there? but it certainly broke any key press.

Thanks for helping Musa

1 Like

:slightly_smiling_face::+1: