Somes Questions

I will add other questions that trouble me.

  1. Set scene problem
  1. I want to zoom in, and zoom out the camera.
    Will try to bring here my solution.
    Edit: Is this ok?

    or this one

I will check at work tomorrow.


Is there a way to use python in the preparation of the scene.

like this. (It’s not working)

import bpy
#change Scene
for area in bpy.context.screen.areas:
	for space in area.spaces:
		if space.type == 'NODE_EDITOR':
			bpy.context.space_data.tree_type ='ArmLogicTreeType'
			ChangeSceneNT= bpy.ops.node.new_node_tree() = "a"
			ChangeSceneNT.add_node(type="LNOnKeyboardNode", use_transform=True)

The Error message is,
"AttributeError:‘SpaceConsole’ object has no attribute ‘tree_type’ "

  1. this one is more a “does what I want is possible?”
    I just don’t now (yet) how to do that but you are in a sphere, inside the sphere is a texture of image. a forest for example. If you select a particular tree you jump to the next scene.
    How to select the tree, a Switch Zelda Bow pointer will be great, bu how to do that.
    I will search for all of that.

  2. The same than 3 but you don’t go to an other scene, you go to a web page giving information about a product, or a popup for the same purpose.

I’ve made a node tree for the zoom in and out with the mouse.

I hope it works and I helped you otherwise just write back.

Try the wheel instead of movement output for the zoom. I have used that successfully in the past.

Thank you very much for your advices. It look completely different than what I had prepared.
Ok, I will look at that.

The point 2.5 completely block my thoughts.

Is it possible like I do with the Cycle node in Python, to make a code to prepare the Blender file, not to be use during the game.

If it was possible,
I would be able to increase my work flow in light years speed.

Edit: It will be more than great I think, Armory would turn into the essential tool of all gamer. or Simple App makers.

Technically it should be possible, but I don’t exactly understand what you are trying to do. You want to make changes to the scene with Python when the game is built? You should be able to make any kind of changes in Blender with Python, but Armory games are actually run completely separate from Blender. The Armory Blender plugin is actually just a really advanced export plugin in concept. The Armory Blender plugin exports a Kha project and then uses Khamake to compile the Kha project to the resulting game.

If you did anything with Python, it would just serve as a way to automate processes in Blender to prepare the scene for export as an Armory game. Is that what you were thinking? If it is, I don’t see any reason why you couldn’t do what you need to. Armory is using the Blender python API just like you would be. ( I don’t actually know much at all of the Blender python api, though, so I can’t tell what you are trying to do in your code sample ).

Also, it might be possible to add hooks to the Armory plugin so that you can execute custom Python scripts that are in the .blend or in the project folder when the export is run.

I think Armory could have great potential for stuff like that, too. :slight_smile:

1 Like

If you did anything with Python, it would just serve as a way to automate processes in Blender to prepare the scene for export as an Armory game. Is that what you were thinking?

Yes exactly, I have tones of identical assets, company around the world possess the same type of assets, and they are increasing.

Since assets are always the same, in the same order, automation is a logical process.

I understood my mistake in the up post.

I have to find the

scn.render.engine = 'CYCLES' = True

But for the logic tree, Searching actually.

Once I found that I automate all the processes of node creation, like the one kindly explain up, and then…
The world is mine!!
(but we are quite far from it)

1 Like

Ah, I get it. You essentially automate the creation of Armory games in Blender for all of the assets. That’s actually pretty cool. :smiley: :+1:

found it
import armory[‘NodeTree’].nodes[‘On Update’]

but data is read only I think.

Have to find the Node New python line.


import armory
import bpy
#put on Cylces
scn.render.engine = 'CYCLES'
#Save File
bpy.ops.wm.save_as_mainfile(filepath='C:\\test\\output\\Work on Script .blend')
#create node tree add first node
LogicTree=armory.bpy.ops.node.new_node_tree(type='CompositorNodeTree', name="NodeTree")
armory.bpy.ops.node.add_node(type="LNSceneNode", settings=NONE, use_transform=True)

this look like to work['NodeTree']"LNSceneNode")['NodeTree']"LNSetSceneNode")

But not this, will continue to share Editing this post.['NodeTree']"On Keyboard")