Jump to content

Model Source Files?


Recommended Posts

I hope I posted in the right spot.

Anyways, I'm looking for the model source files of any of the models for the units/buildings/etc.. I've had troubles with importing the collada files (darn Blender (y)) and the lack of ability to import the .psa/pmd files has made me disappointed. Regardless, I'm wondering if you guys have uploaded the model source files (the model files BEFORE exporting) somewhere online where someone like myself could grab them and play around and make a few edits and what-not. And if they are not online, would it be possible for me to get a hold of a few units just to peak my interest?

Any help is appreciated, even if it means that I'm just blind and can't see the files around :D.

Link to comment
Share on other sites

There is a branch of the SVN server we used for the game that is separated and used by the artists. That server has the majority of all the .max files used in the game. I'm guessing that your looking for original blender files though, eh? (We don't have many - if any of those. All the source 3D files were made in max)

Link to comment
Share on other sites

I tried one example (hele_gym_a.dae) in Blender 2.53 and it looks like it dislikes the <library_effects> - if I delete that then it imports fine. I've no idea why that happens. It'd probably be good to investigate Blender's Collada plugin and work out where the problem is (since it may be a fixable bug in the importer).

m_tunic_long.dae works if I change the TEXCOORD inputs to say set="0" instead of set="1". I don't know whether that should be fixed in our data or in the importer. With that fix, the skeleton and skin imports properly - I can rotate a bone and the mesh deforms properly, so that's good. (I haven't tried exporting back into the game.)

For .pmd files, the work here might be useful for at least static models (buildings etc).

There is a branch of the SVN server we used for the game that is separated and used by the artists. That server has the majority of all the .max files used in the game.
Currently that's non-public since it's huge (~6GB when I last checked) and mixed in with a load of copyright-infringing reference images and suchlike. Maybe we should spend some time working out what files can be released and then put them up on a (non-SVN) server for anyone who's interested.
Link to comment
Share on other sites

There is a branch of the SVN server we used for the game that is separated and used by the artists. That server has the majority of all the .max files used in the game. I'm guessing that your looking for original blender files though, eh? (We don't have many - if any of those. All the source 3D files were made in max)

Well technically any files would do, regardless of format. But I may not need the source files as long as I'm not to lazy to figure it out myself (probably not too hard to do). So I guess I'll just do some trial and error until I run out of options (y).

Thanks for the help though.

Link to comment
Share on other sites

  • 4 weeks later...
  • 5 weeks later...

i have written a python script that fixes the static models (non animated), so they can be imported into blender 2.54. just copy all dae and dds files into a directory and run this script (commandline python scriptname.py) within the same directoy.

# fixscript

filename = "celt_barge-orig.dae"

import xml.dom
import os
from xml.dom.minidom import parse


currentEffectId = 'Undefined'
currentProfile = None
currentTechnique = None
currentMaterial = None
currentEffectFx = None
dom1 = None
hasAddedSurfaceAndSampler = False

def printAttributes(child):
if child.hasAttributes():
if child.attributes:
for attrKey in child.attributes.keys():
print "- attrKey:", attrKey, "attrValue:", child.attributes[attrKey].value
#pass

def recurse(child):
global currentEffectId, currentProfile, currentTechnique, currentMaterial
global hasAddedSurfaceAndSampler, dom1
#print "type:", child.nodeType, "name:", child.nodeName, "value:", child.nodeValue
if child.nodeType != 3:
#printAttributes(child)
pass

if not hasAddedSurfaceAndSampler:
if child.nodeName == 'effect':
# remember current effect id
#print "found effect", child
currentEffectId = child.attributes['id'].value
if child.nodeName == 'profile_COMMON':
#print "found profile", child
currentProfile = child
if child.nodeName == 'technique':
#print "found technique", child
currentTechnique = child

if child.nodeName == "init_from":
#print dir(child.firstChild)
#print "init_from", child.firstChild
if child.firstChild.data[0:4] == 'file':
child.firstChild.data = "./"+child.firstChild.data.split('\\')[-1]
# print "init_from", child.firstChild.value
if child.nodeName == 'texture':
#print "of effect:", currentEffectId
#print "in profile:", currentProfile
#print dir(currentProfile)
"""
<newparam sid="Map__344-image-surface">
<surface type="2D">
<init_from>Map__344-image</init_from>
<format>A8R8G8B8</format>
</surface>
</newparam>
"""

surfaceParm = dom1.createElement("newparam")
surfaceParm.setAttribute("sid", "%s-surface" % child.attributes['texture'].value)
currentProfile.insertBefore(surfaceParm, currentTechnique)

surface = dom1.createElement("surface")
surface.setAttribute("type", "2D")
surfaceParm.appendChild(surface)

initFrom = dom1.createElement("init_from")
surface.appendChild(initFrom)

initFromText = dom1.createTextNode(child.attributes['texture'].value)
initFrom.appendChild(initFromText)

# ---
"""
<newparam sid="Map__344-image-sampler">
<sampler2D>
<source>Map__344-image-surface</source>
<minfilter>LINEAR_MIPMAP_LINEAR</minfilter>
<magfilter>LINEAR</magfilter>
</sampler2D>
</newparam>
"""

samplerParm = dom1.createElement("newparam")
samplerParm.setAttribute("sid", "%s-sampler" % child.attributes['texture'].value)
currentProfile.insertBefore(samplerParm, currentTechnique)

sampler = dom1.createElement("sampler2D")
samplerParm.appendChild(sampler)

source = dom1.createElement("source")
sampler.appendChild(source)

sourceText = dom1.createTextNode("%s-surface" % child.attributes['texture'].value)
source.appendChild(sourceText)

minfilter = dom1.createElement("minfilter")
sampler.appendChild(minfilter)

minfilterText = dom1.createTextNode("LINEAR_MIPMAP_LINEAR")
minfilter.appendChild(minfilterText)

magfilter = dom1.createElement("magfilter")
sampler.appendChild(magfilter)

magfilterText = dom1.createTextNode("LINEAR")
magfilter.appendChild(magfilterText)

child.attributes['texture'].value = "%s-sampler" % child.attributes['texture'].value
textureName = child.attributes['texture'].value

hasAddedSurfaceAndSampler = True

if child.nodeName == "material":
currentMaterial = child.attributes["id"].value
#print "found material", child, child.firstChild.nodeName
for subChild in child.childNodes:
if subChild.nodeName == "instance_effect":
currentEffectFx = subChild.attributes['url'].value
print "found fx", currentEffectFx, "in", child.attributes["id"].value

if child.nodeName == "instance_material":
if child.hasAttributes():
#print "attr", child.attributes['symbol'].value, currentMaterial
if currentMaterial == child.attributes['symbol'].value:
#print "YES"
"""
<bind_vertex_input semantic="CHANNEL0" input_semantic="TEXCOORD" input_set="0"/>
"""
bindVertexInput = dom1.createElement("bind_vertex_input")
bindVertexInput.setAttribute("semantic", "CHANNEL0")
bindVertexInput.setAttribute("input_semantic", "TEXCOORD")
bindVertexInput.setAttribute("input_set", "0")
child.appendChild(bindVertexInput)

if child.hasChildNodes():
for subChild in child.childNodes:
recurse(subChild)

def handleFile(filename):
global currentEffectId, currentProfile, currentTechnique, currentMaterial
global hasAddedSurfaceAndSampler, dom1
currentEffectId = 'Undefined'
currentProfile = None
currentTechnique = None
currentMaterial = None
currentEffectFx = None
hasAddedSurfaceAndSampler = False

dom1 = parse(filename)
for child in dom1.childNodes:
recurse(child)

#tmp_config = 'celt_barracks_weapons-orig.dae'
fw = open("%s-converted.%s" % os.path.splitext(filename), 'w')
fw.write(dom1.toxml())
fw.close()


for f in os.listdir("."):
if os.path.splitext(f)[1] == ".dae":
print "handle file", f
handleFile(f)

Link to comment
Share on other sites

how do we run the script?

As Hypnos wrote "copy all dae and dds files into a directory"

Copy code of the script in some file in the same directory ("scriptname.py" for example)

Write "python scriptname.py" in command line in this directory.

Since you using blender, python should be already installed in your system.

Link to comment
Share on other sites

  • 2 months 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.

 Share

×
×
  • Create New...