Previous Thread  Next Thread

chat icon howto File>New in text editor script

HansHolland

Posted: Sun Oct 21, 2012 4:28 pm
Joined: 21 Oct 2012
Posts: 3
Hi,
I'm new to Blender / Python. I use version 2.64 to view a 3Dmodel generated, for now, by other software (Wavefront .obj format), so I have to switch over and over between generator and viewer. To speed this, I have this script in the Blender text editor:

import bpy
bpy.ops.import_scene.obj( filepath = "c:\models\model1.obj" )
bpy.data.objects["model1"].scale = (25, 25, 25)


Before running the script however, I still have to manually remove the currently displayed model1 using File > New (CTRL N). How can I automate also this in the script? It's a basic question, but I'd like to have this running while starting to learn B/P at the same time!
Thanks Very Happy
Reply with quote


HansHolland

Posted: Mon Oct 22, 2012 7:31 am
Joined: 21 Oct 2012
Posts: 3
better description: scripting Blender GUI commands
Is there a useful add-on for this for my stuff?
Reply with quote


CoDEmanX

Posted: Mon Oct 22, 2012 10:34 pm
Joined: 05 Apr 2009
Posts: 692
bpy.ops.wm.read_homefile()
_________________
I'm sitting, waiting, wishing, building Blender in superstition...
Reply with quote


HansHolland

Posted: Tue Oct 23, 2012 11:32 pm
Joined: 21 Oct 2012
Posts: 3
thanks CoDEmanX!
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group