Jump to content
The Dark Mod Forums

ASE Import Script for Blender 2.53 Beta


rich_is_bored

Recommended Posts

  • 2 months later...

I was disappointed to see that the apparently-pointless character limit for material names is still existent in Blender 2.5, which means that LWO is still not very usable for Doom 3. However, there are now "Custom Properties" which could be used to get around this.

 

Perhaps your .ase importer could store the original *BITMAP path in a custom property on the object, e.g. "Doom3ShaderName", and then the export script (when it is developed) could use this value to override the *BITMAP line on export, leading to a truly read/write workflow for Blender and ASE files. The LWO import/export scripts if and when they exist could be modified to do the same thing.

Link to comment
Share on other sites

Actually in the latest version of the script (which has not been made available yet) I preserve the *BITMAP path by storing it as an image reference, which just so happens to be the intended use.

 

Of course in this case "textures/darkmod/stone/flat/smooth_marble_grey02_ed" for example may reference a non-existent image file but Blender doesn't prevent you from making a bogus reference. It raises a benign warning.

 

post-1779-12773531073_thumb.jpg

Link to comment
Share on other sites

Ah yes, that would work too I guess, since in Blender 2.5 you can also type an arbitrary path in the Image box even if it does not correspond to an actual image. I seem to recall there was some problem trying to do this in 2.4.

 

Of course, this would prevent you from using an actual image (for preview inside Blender) which had a different path to what the Doom 3 shader was supposed to be, which would make the custom property approach useful as well.

Link to comment
Share on other sites

It's something to think about. I can always tack options on at a later date.

 

Did you know you can pack image files inside of a blend file? Technically it's possible for a plugin to retrieve all the relevant images from the PK4s, pack them into the blend file, and map them to the proper channels.

 

GLSL mode with a diffuse, specular and normal map loaded can yield objects that look almost exactly as they would in game...

 

http://www.doom3world.org/phpbb2/viewtopic.php?p=217674#p217674

 

Of course that's far beyond the scope of an ASE import plugin and I'm not prepared to invest that kind of time but it's a cool idea.

Link to comment
Share on other sites

Did you know you can pack image files inside of a blend file? Technically it's possible for a plugin to retrieve all the relevant images from the PK4s, pack them into the blend file, and map them to the proper channels.

 

That was one of the ideas behind DarkResource, which aside from being a user-friendly resource editor would also provide a command-line tool to check images etc in or out of PK4s for use by scripts. It's very much a "background project" at the moment though, so whether it will advance to any stage where it is actually useful remains to be seen.

Link to comment
Share on other sites

I've decided to upload the latest version of the script for SneaksieDave. It exibits none of the problems he describes although it is WIP so there are probably bugs.

 

The link in the first post has been updated.

 

Thanx for the update, rich! (We really should make you a team member :)

 

Since the changing links are bad for the wiki page, I mirrored this script and the DR ASE export script on http://bloodgate.com/mirrors/tdm/pub/scripts/ and puts links to both of them here:

 

http://wiki.thedarkmod.com/index.php?title=Running_Scripts_in_Darkradiant

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

:) Thanks rich, it appears to work nicely (best as I can tell).

 

-------

 

Do you also have an ASE export script for Blender planned, or does anyone else? Or perhaps the DR one can be dropped in (hopeful) since they're both using python plugins?

 

As an alternate, I tried the following workflow, but without great results:

Export ASE from DR (success);

import ASE to Blender 2.52 (success);

save as .blend from 2.52 (success);

load .blend into 2.43 (success with warnings about some data might be lost);

export ASE from 2.43 (success?)

 

It looks like the geometry was saved, but not the materials (I guess we might have expected that with how blender and ASE use materials?), and the scale was quite off. But I guess with extra manual work it could probably be used if there was no other choice.

 

Here's hoping you have a 2.52 export script up your sleeve though. ^_^

Link to comment
Share on other sites

Nope, such a thing as code sharing won't work as the Python API (the public methods provided by the application) of Blender and DarkRadiant are completely different.

 

I meant to have a look at rich's export script for DarkRadiant and maybe find a way to automate the vertex blending process a bit, but it's one of many things to do. And if nobody else is going to work on an ASE exporter for Blender 2.5, I might give it a go for the fun of it.

Link to comment
Share on other sites

Possibly there could be some code sharing, such as for the back-end ASE writing code, but certainly a drop-in replacement won't be possible because the scripts will need to access totally different interfaces as greebo said.

Link to comment
Share on other sites

  • 2 weeks later...

Blender 2.49b. I downloaded the import ase file. There was no io folder in Blender's scripts folder so I made one and put the file in there. But I can't see it on the import menu. What would it be named? I also tried it directly in the script folder but still can't see it. Inside the py file it has name: ASCII Scene Importer but I don't see that on the menu. Not shown as ASE either.

Link to comment
Share on other sites

I would guess that a script for Blender 2.5 will not work in Blender 2.4x because of the considerable changes introduced with the 2.5 series.

 

The existing ASE import/export scripts on Doom3World work with the 2.4x series, but I'm not sure up to what specific version.

Link to comment
Share on other sites

More of my silly googles but it might still be valid:

 

1) Install Python 2.5 (rather than the one Blender installs)

 

2) Get Blender to "find Python"

 

Blender Forum thread

 

...c'mon google! :)

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

I recall having problems with the scripts at doom3world due to some indentation error. Can you try these two files?

 

Rename them to .py (remove the .txt) and put them into .blender/scripts (note the dot at the beginning of the .blender directory name.) For me this is something like C:\Program Files\Blender\.blender\scripts

ase_export.py.txt

ase_import.py.txt

Link to comment
Share on other sites

Thanks. This import worked with the fireplace model but not my test cube export from DR. It has more options (5 of them) so I tried them all without success before realizing they are not mutually exclusive so there are a lot of combinations. Don't know what these errors mean...

 

Import File:  G:\ZZTEMP\test_cube.ase
Read file...
Import Objects...
Traceback (most recent call last):
 File "G:\Blender\.blender\scripts\ase_import.py", line 733, in read_ui
   read(filename)
 File "G:\Blender\.blender\scripts\ase_import.py", line 693, in read
   spawn(ase_objects)
 File "G:\Blender\.blender\scripts\ase_import.py", line 349, in spawn
   spawn_mesh(scene,ase_ob)
 File "G:\Blender\.blender\scripts\ase_import.py", line 461, in spawn_mesh
   inv_matrix = ob.getMatrix().copy().invert() * scale
ValueError: matrix does not have an inverse

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...