Blender Import/Export Script?

Discuss the future of Warzone 2100 with us.
Hectichermit
Greenhorn
Posts: 13
Joined: 01 Apr 2007, 02:54

Blender Import/Export Script?

Post by Hectichermit »

Okay this is for yall programmers...
Is there anyway to make a import/export Script for PIE slicer for Blender?
Kamaze
Regular
Regular
Posts: 1017
Joined: 30 Jul 2006, 15:23

Re: Blender Import/Export Script?

Post by Kamaze »

Yes, with python. Someone already made one (but still alpha)... searching ...

Found it, but it seems to be only for 3DSMax: http://wz2100.net/forum/http://localhos ... 1935#p1935
We all have the same heaven, but not the same horizon.
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Blender Import/Export Script?

Post by Watermelon »

I think cypersphinx has a pie-to-blender script written in python,but he said he couldnt write a blender-to-pie one because pie format doesnt support float points currently,which means all models vertex coords in blender format will be truncated to int during blender-to-pie conversion,killing its visual quality instantly.I tried to add float point supports,but unfortunately there were some corruptions with the wateredge textures after the int to float changes,and now the code base is changed greatly since I created/tested that patch,so I dont have time resolve hundreds of conflicts manually and gracefully.
tasks postponed until the trunk is relatively stable again.
Hectichermit
Greenhorn
Posts: 13
Joined: 01 Apr 2007, 02:54

Re: Blender Import/Export Script?

Post by Hectichermit »

I was looking over the forum link Kamaze posted and I remember that I tried going into modding for Civ 4 but there was a problem with textures when you  exported to the Nif format.....well ill guess I could try and see if I could work on something else for warzone.....I was woundering if yall had any of the old game movies from warzone like the intro or the campaign videos I could use that as a reference.....
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Blender Import/Export Script?

Post by cybersphinx »

I'll attach Rodzilla's Blender import script (if someone's interested I'll add mine too, but I've stopped at loading vertices...), that sort of works. I guess export will have to wait until Warzone uses a useable model/texture format.
Attachments

[The extension has been deactivated and can no longer be displayed.]

We want information... information... information.
User avatar
Hatsjoe
Trained
Trained
Posts: 285
Joined: 20 Feb 2007, 19:57

Re: Blender Import/Export Script?

Post by Hatsjoe »

Hectichermit wrote: I was looking over the forum link Kamaze posted and I remember that I tried going into modding for Civ 4 but there was a problem with textures when you  exported to the Nif format.....well ill guess I could try and see if I could work on something else for warzone.....I was woundering if yall had any of the old game movies from warzone like the intro or the campaign videos I could use that as a reference.....
Yes we do, but since the movies are still copyrighted we cannot share them. I'm sure that if you keep lookng for it you might find them somewhere. Not in this forum though.
Image
User avatar
Terminator
Regular
Regular
Posts: 1077
Joined: 05 Aug 2006, 13:46
Location: Ukraine
Contact:

Re: Blender Import/Export Script?

Post by Terminator »

Watermelon wrote: I think cypersphinx has a pie-to-blender script written in python,but he said he couldnt write a blender-to-pie one because pie format doesnt support float points currently,which means all models vertex coords in blender format will be truncated to int during blender-to-pie conversion,killing its visual quality instantly.I tried to add float point supports,but unfortunately there were some corruptions with the wateredge textures after the int to float changes,and now the code base is changed greatly since I created/tested that patch,so I dont have time resolve hundreds of conflicts manually and gracefully.
What if at the beginnig of modeling use int (correct coordinates) ? Will that script export(Blender-to-pie) a model ?

Because I wanted to export my wz_logo to pie & may be possible to use it(logo) in the main menu instead of pictured logo ?

I will better correcting coordinates in 3dsMax that to model the same in that pieslicer  :-[
Death is the only way out... sh*t Happens !

Russian-speaking Social network Group http://vk.com/warzone2100
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: Blender Import/Export Script?

Post by Giel »

This is the Blender import/export script for PIE files currently in the Subversion repository: http://svn.gna.org/svn/warzone/trunk/tools/blender/ (freely usable under the terms of the GNU General Public License).

This script will indeed work best on coordinates of integer precision. It will otherwise either round numbers down or up to an integer precision format which might be ugly, so using integer precision in your source model probably yields the best results.
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Blender Import/Export Script?

Post by DevUrandom »

That reminds me of my request to make that script support float precision... (The trunk engine should be able to handle it already.)
User avatar
Terminator
Regular
Regular
Posts: 1077
Joined: 05 Aug 2006, 13:46
Location: Ukraine
Contact:

Re: Blender Import/Export Script?

Post by Terminator »

Giel wrote: This is the Blender import/export script for PIE files currently in the Subversion repository: http://svn.gna.org/svn/warzone/trunk/tools/blender/ (freely usable under the terms of the GNU General Public License).

This script will indeed work best on coordinates of integer precision. It will otherwise either round numbers down or up to an integer precision format which might be ugly, so using integer precision in your source model probably yields the best results.
Its doesn't work or I dont know how to install it. I put it in the script folder and its shows in export\import menu but when I press on it > massage "Script error":
console:
export script

Code: Select all

 File "<string>", line 2, in <module>
ImportError: No module named __future__ 
import script

Code: Select all

 File "<string>", line 46, in <module>
ImportError: No module named glob
I'm using Blender 2.44 (latest)
Death is the only way out... sh*t Happens !

Russian-speaking Social network Group http://vk.com/warzone2100
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Blender Import/Export Script?

Post by DevUrandom »

Python cannot find the glob and __future__ modules, which are part of Python.

Does Blender come with an own installation of Python on Windows?
Otherwise you should try to update your installation of Python to 2.4 or 2.5 (2.4.4, which I have here, has the glob module).
If Python comes only with Blender, I currently have no idea, since I never before worked with the combination Blender+Python+Windows.
Last edited by DevUrandom on 17 Jun 2007, 23:39, edited 1 time in total.
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Blender Import/Export Script?

Post by Watermelon »

DevUrandom wrote: That reminds me of my request to make that script support float precision... (The trunk engine should be able to handle it already.)
yea I think gerard_ did the python scripts? maybe you can try to reach on mailinglist/via email and ask him to add the float support in his scripts?
tasks postponed until the trunk is relatively stable again.
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: Blender Import/Export Script?

Post by kage »

if you can link me to the import script, i could probably fix both bugs...

2.44 for the windows version? yeesh, at least 4.0 is doing everything i need so far...

EDIT: i now see you're referring to the blender version. also, a link to a valid version 5 pie file would help
Last edited by kage on 18 Jun 2007, 11:31, edited 1 time in total.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Blender Import/Export Script?

Post by DevUrandom »

http://svn.gna.org/viewcvs/warzone/trunk/tools/blender/

For the PIE5 scripts I thought that there could be a dropdown list in the export dialogue to choose the target version from?

Currently PIE5 is nearly not much different from PIE4:
- POINTS take floating point numbers
- POLYGONS have floating point UV coordinates

I will very probably change the range of the UV coordinates from 0.0-256.0 to 0.0-1.0 to match default the OpenGL coordinate range and improve the precision. You could already incorporate this change, even if the engine currently doesn't support it.
Post Reply