copy mesh data to script??

Hi,

is it somehow possible do copy mesh data to a script? I ask myself if it is possible to make a complex model and copy the data to a python script. Something like simple copy and paste :o

I have realy not much experience with python…but an easy copy and paste of data with some extra code… don`t know.

Is it possible to get the data of a mesh for a mesh creation script?

maybe a bit funny question for pro`s …

Thanks in advance!

Piet

do you mean you want to take an existing mesh, and generate python code from it which is able to create the same mesh again?

http://www.ewocprojects.be/creaprim.html

Hi codeman,

yes exactly, thats what I want. Your link to lightwave files I/O ?? dont understand.

Thank you codeman! But is it possible?

Weird, the website is obviously broken. Here’s the actual script:
http://www.ewocprojects.be/object_creaprim.py

CreaPrim does what it says. I takes the active object and turns it into an Add Mesh addon. When you enable this, your custom object will be added to the Add->Mesh menu.

Documentation

Go to User Preferences->Addons and enable the CreaPrim addon in the Object section.

First select your object or objects. The addon will show up in the 3dview properties panel.
The name (in panel) will be set to the active object name. Select “Apply transform” if you
want transforms to be applied to the selected objects. Modifiers will taken into account.
You can always change this. Just hit the button and the selected
objects will be saved in your addons folder as an Add Mesh addon with the name
“add_mesh_XXXX.py” with XXXX being your object name. The addon will show up in User
Preferences->Addons in the Add Mesh section.

Enable this addon et voila, your new custom primitive will now show up in the Add Mesh menu.
REMARK - dont need to be admin anymore - saves to user scripts dir

ALSO - dont forget to Apply rotation and scale to have your object show up correctly

Cool! Sounds good. By the way is it posible to run the script and the mesh apears on the fly? Have no time to play with that tonight but I`ll do next days.

Thanks codeMAN :slight_smile: thats a step forward! N8

“on-the-fly”?

The script doesn’t work like that, but you can basically generate a mesh on every frame change (doing it on every redraw is not recommeded).

o.k. Thanks a lot! I did mean directly… on the fly :wink: bad english…was tired.

Hi Codeman,

did test the script… not realy what i was looking for… Difficult… “Just” copy mesh information from a .blend file or open scene inside a script that way i can run the script and the mesh is there. Without addon installation. I know it needs a lot more experience with coding. But I cant imagine… in case of complex models for a script… it is not nessesary to code the whole creation process of the mesh.
Thanks a lot and sorry if that is completely stupid. Just create something without a lot of coding knowledge and use that for a script.
Maybe some kind of mix between coding and using blender.
I have no idea…at the moment… but I know when I want to do things I have to learn more python or coding stuff. Difficult to find a good point to start. Dont know how to describe it better.
Delete this post if thats to crazy or maybe some advice how to start would be nice.

Thanks
Piet:o