Hello to all I thought it should be cool to share my work on preseting a scene using python.
I am planing to :
-change scene
-move up down left right the camera
-scrole by the mouse.
But first.
Is the setting bellow works on your computer???
It does not on my laptop.
If I do it with node it’s working.
Any advice will be welcomed.
#PreparationAutomatisationNodesArmoryVersion2
#you need to create a new scene, full copy, take care about Engine.
import armory
#put on Cylces
scn=bpy.context.scene
scn.render.engine = 'CYCLES'
#Save File
bpy.ops.wm.save_as_mainfile(filepath='C:\\test\\output\\Work on Script.blend')
#change Scene Node Tree
#create the Node tree
armory.bpy.ops.node.new_node_tree(type='CompositorNodeTree', name="NodeTree")
#the nodes
LogicTree=armory.bpy.data.node_groups['NodeTree']
ScnNode=armory.bpy.data.node_groups['NodeTree'].nodes.new("LNSceneNode")
SetScnNode=armory.bpy.data.node_groups['NodeTree'].nodes.new("LNSetSceneNode")
OnKBoard=armory.bpy.data.node_groups['NodeTree'].nodes.new("LNOnKeyboardNode")
#twinking the nodes bouttons
OnKBoard.property0 = 'Down'
OnKBoard.property1 = 'a'
ScnNode.property0 = 'Scene.001'
#link the nodes
LogicTree.links.new(ScnNode.outputs['Scene'],SetScnNode.inputs['Scene'])
LogicTree.links.new(OnKBoard.outputs['Out'],SetScnNode.inputs['In'])
#link the node tree to the object.
#object actif, ici le cube
bpy.ops.arm_traitlist.new_item(is_object=True)
bpy.context.object.arm_traitlist[0].type_prop='Logic Nodes'
bpy.context.object.arm_traitlist[0].nodes_name_prop = "NodeTree"