how to create .blend files using some script or command line. :)

Hi blender artists,

I just joined blender artist forums as i see massive support for blender. I am working on a corporate project using blender and i know what im doing is possible but dont know how to do it. Here is what im trying to do.

  1. Use website to grab input for an object (building basically)
  2. Use form posts to write values to a text file (building specs e.g height, walls, predefined textures, etc)
  3. Click “finish” in the end and a .blend file is generated using some python script in the backend maybe??
  4. Display the object using 3D web plugin for blender.

This is a huge project for me and help will be HIGHLY appreciated.

with thanks and regards,

Lucifero :o

I haven’t done any of the steps involved so I can’t tell you exactly how to do it, but I might be able to point you in the right direction.

I think you can set up a .blend file so that a python script will run when the .blend file is opened (or maybe it’s a command line option?).
Set up a .blend file with a script that is going to do the conversion for you.
Run blender with that .blend file from your web server.
Have your .blend/script read in a file - you might need to always use the same file name and just change it’s contents from your web form.
Have your .blend file change itself and then save as (I’m not even sure you can do a save as from python?).

Of course you probably knew all that and just wanted to know how to actually do the steps - if so, sorry.

would you not have to model some of the items first and then define dimensions using values. So eg) 4 walls and a roof, if it was highly detailed you might have, hieght of wall, depth, length, how many windows, hieght of windows…and so on. The roof of the building would have to change to accomodate your values. And so allthough you could code in python everything (like a plane at 90 to another plane) is the roof at 45 to the wall, would that not be better modelling and using arrays and dupplicated objects?

Yeah… objects need to be linked accordingly which should be handled by the Coldfusion appliation. I need to define arrays[] first in the application side. I am trying out various scenarios to accomplish this and one of them should workd :slight_smile: I’ll enlighten you guys when im done. Thanks for the awsome support.

The web plugin in blender uses the Game engine. In the Game engine you can send messages (using logic buttons) to different functions to perform different actions.
You can send messages to the web plugin using javascript in an html file.

In the game engine, in a python script, you could receive messages and change object sizes/colour accordingy. (you could prob do it without python, but just by using ipos.)

Chris Want (Hos on this forum) did something that might be interesting to you.
Links: [1] [2]

Gee thanks. I wonder if i can find Chris on this forum but this is what i was looking for. (Y) thumbs up.

… & regards