Jump to content
The Dark Mod Forums

ASE Import Script for Blender 2.53 Beta


rich_is_bored

Recommended Posts

@rich_is_bored: one problem I can report (though perhaps not an issue for the DR<->Blender workflow) is that for an unknown reason some ASEs don't import. Take for example:

\darkmod\models\darkmod\misc\bell01.ase (nor bell02)

 

This was made with an older version of blender, perhaps 2.43. But since it's an ASE, and not an older format .blend (if such a thing exists), I would have expected that wouldn't matter, that an ASE import was an ASE import... Won't import successfully, though.

 

---------

 

And one other issue, possibly just question/not understanding proper usage: When I import my geometry for DR, everything appears fine. Exporting again with the new script then spits out the ASE, and again, everything looks fine in DR. However, if I need to change the textures or UV mapping in Blender, then I'm a bit at a loss. When I open the UV editor, no images are displayed.

 

I assume if I then load images myself, I will disturb the clean process between DR and Blender, so all bets are off.

 

If this is correct, that no textures show in Blender because they are in DR/TDM's format, can the suggestion by OrbWeaver be used to convert texture names back and forth between the two, so they can also be viewed and manipulated in Blender? This appears to be the last sticking point for the DR<->Blender workflow.

Link to comment
Share on other sites

Mmm... the texturing was my main concern. Although I didn't actually see any textures in Blender when I did my quick test I assumed that was because I wasn't in texture mode. I was mainly focused on the import/export. I'm rusty now on Blender 2.49 and never used 2.5 other than that one quick test so I'd have to check back to see how to do eg, vertex blending.

 

BTW I forgot to mention that when I exported from Blender I don't recall having to set any options. I think on importing there were several so which would be the correct one? Well, no matter, they are questions for the future when I have time to look at it again.

Link to comment
Share on other sites

I haven't tested the script, but assuming that the custom property approach is not being used, the only way the ASE can store the correct shader path such that it imports into Doom 3 with the correct material is by putting the full material name in the *BITMAP line in the ASE. Unless there happens to be an image on your hard disk with the same path, this will presumably result in Blender not displaying any image in its UV editor.

Link to comment
Share on other sites

I tried fiddling around but so far no success. [Edit] Okay so as Orb just said, the *BITMAP line isn't a file, but a material (in Doom at least). The one in my model is, for example:

 

*BITMAP "\\purgatory\purgatory\doom\base\textures\darkmod\stone\brick\long_cracked_blocks"

 

I don't know what's with the purgatory stuff.

 

*MAP_NAME is another line that seems useful. it was

 

*MAP_NAME "textures\darkmod\stone\brick\long_cracked_blocks"

 

and I changed it to a file path,

 

*MAP_NAME "D:\doom3\darkmod\dds\textures\darkmod\stone\brick\long_cracked_blocks"

 

But this didn't help either. Well, either that or textured mode and UV mapping is busted in 2.52, which I can't tell or not. Simply using textures has always been IMO the most confusing thing about Blender.

 

I was hoping the *MAP_NAME would be the sharable path between Blender and DR but I guess that would be too easy.

Link to comment
Share on other sites

I had a look at bell01.ase and bell02.ase. They both have two comment tokens like this in the header...

 

*3DSMAX_ASCIIEXPORT	200
*COMMENT Author: SneaksieDave
*COMMENT "Exported from Blender 242 - Sun Sep 03 01:32:15 2006"
*SCENE {

 

I don't know if you added this information yourself or if it was the export script you used but none of the models from Doom 3 have two comment tokens and if you remove one it will import just fine. If adding author information to the file is important to you then put it all on one line like this...

 

*3DSMAX_ASCIIEXPORT	200
*COMMENT "Exported from Blender 242 - Sun Sep 03 01:32:15 2006 - Author: SneaksieDave"
*SCENE {

 

As for the second question, no images are loaded because all that's present in an ASE exported from Dark Radiant or produced for use with an idTech 4 based game is a material shader reference.

 

In order to load images I need to extract all the .mtr files for whatever mod you happen to be working on, find the .mtr that contains the material shader being referenced, extract all the images referenced in that shader, and hope those images are TGA or JPG as DDS is not supported.

 

Then we get into the issue of a material shader having three separate stages, diffuse, normal, and specular. It's simple enough to load these images into the appropriate channels within Blender but these files do not always share the same name as the material shader in which they are used. That's a problem when it comes time to export.

 

I could use a custom property to store the material shader reference but then I'd have to create a custom panel so you could change it.

 

That aside, image textures aren't assigned to objects through the UV editor. They're assigned using the texture properties panel in the default layout.

Edited by rich_is_bored
Link to comment
Share on other sites

So we can work around this? Say we import an ase and find the images ourselves from the material shader and if we then assign those textures in Blender does that solve it? Personally all I want are the diffusemaps in Blender. (I think!)

 

The two main uses for these scripts for mappers' general use imo is to be able to easily resize existing models and also to export geometry to a model so its textures can be blended using vertex blending. I want to be able to make these uses as easy as possible or mappers generally won't use them. They won't want to know how it works but just follow a list of steps.

 

To convert geometry to a model for its own sake I don't know if there is any advantage?

Link to comment
Share on other sites

You can assign multiple image textures to a model and preview it textured provided the images are in a supported file format (DDS is not). That in and of itself is a means to preserve the material shader reference. You just need to add an additional texture channel to the model for your diffuse map and delete it before you export.

 

If this is going to be a common practice I can make adjustments to the script so that only the first texture channel is used for the material shader reference and everything else is ignored.

 

It also might be possible for the DarkRadiant export script to extract the relevant images and place them in the same location as the model. I have to look over the API to see if that's possible but it would simplify the problem a great deal.

 

I don't recommend exporting things to ASE for the hell of it. We have an article on modwiki that compares models versus brushes that's worth a read...

 

http://www.modwiki.net/wiki/Models_vs_brushes

Link to comment
Share on other sites

I could use a custom property to store the material shader reference but then I'd have to create a custom panel so you could change it.

I think that'd be quite welcome. Even if most of the time it just sits there not being touched by the mapper, for those times when it is, it would be very useful to be able to modify it (or add additional, which is arguably even more important).

 

If this is going to be a common practice I can make adjustments to the script so that only the first texture channel is used for the material shader reference and everything else is ignored.

Does that include multiple materials (from DR) or just one?

 

Sorry if so many of these questions are just plain ignorant, but much of this is alien to the point where I admittedly don't understand many of the (I assume basic) references you're making.

Link to comment
Share on other sites

I don't think a custom panel would be needed to use a material shader property, it can easily be edited in the "Custom Properties" section of the tool panel. A custom panel on export would be a nice touch, but the script wouldn't be useless without it.

Link to comment
Share on other sites

Say you export a brush with one face textured with rock and the remainder of the brush is textured with brick. When you export this brush from DR it's going to be split into two mesh objects. One object will be the single face textured with rock. The other will be the remaining five faces textured with brick.

 

When imported into Blender the material shader applied to each object is stored in the first texture channel for each object. But in a modeling program you aren't limited to using a single texture. You can use multiple images layered on top of each other where each image resides in a separate texture channel.

 

Instead of using the first texture channel to refer to an image, I'm using it to store the name of the material shader you applied in DR. Since the name "textures/darkmod/whatever" doesn't refer to an actual image file on your hard drive no image is found and no texture is applied in the viewport.

 

But since you aren't limited to one texture channel per object, it's entirely possible to load the actual diffuse texture into a second texture channel. Since it will be a valid image reference, a texture will show up applied to the object in the viewport.

 

At present, the export script assumes each texture channel assigned to an object is a material reference. But if people use a second texture channel to reference an actual image file, it would be erroneous to assume that every channel referred to a material shader.

 

The solution is either to require you delete additional channels you've created once you've finished vertex painting or modify the export script so that I only capture shader references from the first texture channel.

 

Confused yet? :laugh:

Link to comment
Share on other sites

Surprisingly, I was going strong until the last two statements.

 

How about a special case of the general scripts, just for DR stuff? Have the main version of the script behaves as it does now, flexible for any ASE imports and exports, and not limited to DR work. Then have a second, specialized version of the script which uses those modifications to use the first channel in this way to make it friendly for the DR<->Blender workflow?

Link to comment
Share on other sites

Confused yet? :laugh:

 

Haha - yeah. I probably won't grasp it until I get time to experiment properly which likely won't be for a few months. Hope you're still around then for interrogation unless someone writes a really clear dummies' tutorial before then. :)

Link to comment
Share on other sites

I don't see how there can be any genuine need for different script versions: an ASE is an ASE, and the "*BITMAP = material shader" requirement is imposed by Doom 3 itself, not DR or the Dark Mod. Whether the script deals with this via a custom property or another method, the behaviour would be the same with TDM or any other Doom 3 mod.

Link to comment
Share on other sites

As I was mentioning in the other thread I guess there was just some misunderstanding. The only reason I've pursued this type of functionality (and suggested a specialized version) was because it sounded like the intention was to have the DR<->blender ASE workflow be completely seamless. No manual editing of materials in ASE files, for the ease of the users. To do so it would need special treatment of blender materials and TDM materials. If that's not the goal, then I just misunderstood/got over hopeful for it.

 

Sounds like the workflow instead is:

 

A. For DR exports, you can modify shapes some (not sure to the extent of this; maybe you can preserve materials within objects... or maybe if you add new polys you're screwed?), adjust verts etc, and vertex paint, without any ASE file hacking. I don't know how to do it yet but I hear there's a tutorial coming. This is good to have of course.

 

B. For general purpose ASE, this gets us an up to date version of a script for exporting ASE, and then the user can manually hack the *BITMAP lines to work with TDM as previously. A bit scary thing that probably unfortunately keeps many users away from even trying (even though it's probably the easiest step they'll encounter in learning blender). This is good too though.

 

A set of general ASE export/importers for DR and blender is definitely great in itself, so all efforts are appreciated here. At this time I know of a remaining issue, mentioned in the blender export script thread.

Link to comment
Share on other sites

  • 1 month later...

I've completed an ASE import script for Blender 2.53 Beta.

 

Download

 

Just place import_ase.py into your scripts/io folder and ASE will show up under File > Import the next time you start Blender.

 

 

Just dl'ed 2.53, went to place this into scripts/io but there is no script folder anywhere. Do I have to create one?

 

edit--

 

yeah I put a scripts/io folder into the blender/2.53/python folder

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

  • 5 years later...

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
       
      · 1 reply
    • 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...