Jump to content

Actor Importer For Blender


Stan`
 Share

Recommended Posts

Currently, it can be a little annoying to get a mesh from the game in Blender, especially when it has a lot of props.

So I created this little blender addon for blender 2.8

What it does is it loads all the files used by the actor recursively (it picks random variants like the game does) and place all objects on their respective prop points using constraints. (Do not forget to disable constraints before exporting, else you might get into trouble)

It also assign a diffuse, norm and spec material to the object

 

@Syn I believe this will be way better than the explanation I gave you by e-mail, as it's a one click business

@Alexandermb @LordGood @Enrique @Trinketos

@The Undying Nephalim I believe you only use blender as a proxy, but it might be helpful for you as well.

 

Here is an example with a model with a lot of props

 

image.png

image.png

image.png

 

You can test it here https://github.com/StanleySweet/blender_pyrogenesis_importer/releases/download/1.3.6/io_scene_pyrogenesis.zip

 

EDIT: Textures are assigned in the link above.

EDIT2:  The importer may edit files, to remove materials, effects or images that might have broken the import otherwise

EDIT3: Update version.

 

  • Like 9
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

Hello I tried your plugin and unfortunately it gave me the following error messages when importing ....

Traceback (most recent call last):
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 124, in execute
    return self.import_pyrogenesis_actor(context)
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 263, in import_pyrogenesis_actor
    self.parse_actor(root)
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 448, in parse_actor
    fixer.execute()
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 674, in execute
    warnings.warn("subchild: "+ subchild.tag)
NameError: name 'warnings' is not defined

location: <unknown location>:-1

Link to comment
Share on other sites

49 minutes ago, Alcibiades said:

Hello I tried your plugin and unfortunately it gave me the following error messages when importing ....

Traceback (most recent call last):
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 124, in execute
    return self.import_pyrogenesis_actor(context)
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 263, in import_pyrogenesis_actor
    self.parse_actor(root)
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 448, in parse_actor
    fixer.execute()
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 674, in execute
    warnings.warn("subchild: "+ subchild.tag)
NameError: name 'warnings' is not defined

location: <unknown location>:-1

Sorry for the inconvenience can you try with the fix I just pushed?

Link to comment
Share on other sites

Thank you so much.

The majority of the units I have tested are now importing into Blender 2.81. This Addon is very helpful. There are some units still giving errors such as below.

\0ad-master\binaries\data\mods\public\art\actors\structures\athenians\trireme.xml

Traceback (most recent call last):
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 124, in execute
    return self.import_pyrogenesis_actor(context)
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 263, in import_pyrogenesis_actor
    self.parse_actor(root)
  File "C:\PortableApps\BlenderPortable\Data\user_scripts\addons\io_scene_pyrogenesis\__init__.py", line 430, in parse_actor
    variant['props'].append(prop)
TypeError: element indices must be integers

location: <unknown location>:-1

 

Link to comment
Share on other sites

Interesting, thanks. In general I would avoid animated objects. The support isn't complete and action are not imported. For those it's better to use the blendfiles when available. Let me know if you need a specific one.

Might I ask what your use of the tool is?

  • Like 1
Link to comment
Share on other sites

4 minutes ago, Stan` said:

Interesting, thanks. In general I would avoid animated objects. The support isn't complete and action are not imported. For those it's better to use the blendfiles when available. Let me know if you need a specific one.

Might I ask what your use of the tool is?

I began learning Blender in my spare time 6 months ago and I am fascinated by Ancient Civilizations. Exploring the models helps me understand how they are made and if I can I would like to contribute as my skills improve.

  • Like 1
Link to comment
Share on other sites

1 minute ago, Alcibiades said:

I began learning Blender in my spare time 6 months ago and I am fascinated by Ancient Civilizations. Exploring the models helps me understand how they are made and if I can I would like to contribute as my skills improve.

@feneur can you lift his post limit.

Nice to hear! Let me know if there is anything I can do to help you get started. Like if you need help creating a mod, getting a model in the game or looking for a specific topic related to art. You can also anything you might need for this project really.

Link to comment
Share on other sites

8 minutes ago, Alcibiades said:

From what I read they are usually black & white for game engines for performance reasons but this is all new to me.

 

Usually they are (Actually most of the time), but our engine supports using the color channel and the alpha channel to do stuff.

Link to comment
Share on other sites

  • 1 month later...

Yes thank you I just discovered the game and I find it amazing. I downloaded the add-on but where are the dae files? And how to import them? I thought the add-on was for special files I found but it only suggest xml. My problem is that I don't know how to find dae file : all that I found is dae.cached.pmd (D:\jeux\0 A.D. alpha\binaries\data\mods\public\public.zip\art\meshes\structural), and I don't know how to import them. After yhat, I suppose that I only need to replace them to change the game objects.

Edited by Bestinbest
orthographe
Link to comment
Share on other sites

In your local install all of the games assets are found in the public.zip though the textures/images are in compressed dds format which you may find a bit tricky to open with out a dds plugin for your image editing app the reason that it's under mods is that even the main game is in fact a mod for the base engine which you can also see on the mod selection screen so do not disable it on that screen by mistake ;) if you have problems getting to a file on your hard drive you can browse the svn repo on trac which you can get to by the Development link on the forums header that's also our wiki with lots on useful links there.

Enjoy the Choice :)

Link to comment
Share on other sites

2 minutes ago, Bestinbest said:

Speaking english is not to hard for me but maybe for who reads me:rolleyes:. Is it possible to get the development version?

Sure it is possible. 

If you are more familiar with git you can clone the repository https://github.com/0ad/0ad

(It is slightly less up to date (lagging one day behind) and you'll need to compile the game if you want to play)

Else you need to clone the SVN repository

https://svn.wildfiregames.com/public/ps/trunk/

If you need to build you'll find more detailed information here.

https://trac.wildfiregames.com/wiki/BuildInstructions

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.

 Share

×
×
  • Create New...