Long time no post, I have a question for a much newer version of blender than I usually talk about.
So I may be doing some exporting through blender 2.83, I have one script to export to a specific game, and that works. But I will also need an export option which maintains textures, materials and rigging. I seem to remember .3ds allowed rigging and textures as well. (EDIT: and I found out the rest of the dev team is using Max 2015, so, yeah a 3ds import/export is important). However I cannot for the life of me find a copy of the 3ds import export addon that actually installs at all. I mean they say they install but they donāt show up. I was reading here on this forum that the import option works but the export doesnāt yet for me nothing would install not import nor export.
does anyone have any information about this?
OK I kept working at it, it seems that for some reason it needs to be in a folder named 3dspy for it to show up. now Iām working on errors in it. someone left these 3DS script littered with non python comments with triple quotations āā" rather than #.
OK, āSome Assembly Requiredā I got it to stop giving errors and output the file.
now the question becomes āwill anything be able to open it?ā
The answer to that, is āYesā now to test with something textured and rigged.
The Answer to Textured is āNOā there are errors on import. which means something isnāt right. oh well maybe Iāll look at it again tomorrow. It appears to be a cutoff material name when it tries to do makeMeshMaterialCopy, not sure why. oh well. As for rigged, it doesnāt like objects named armature. gave a key error when it asked for the meshās parent and it was an armature named armature, Oh, I see itās trying to save the armature as a mesh. lol that wont work. nope, itās trying to get the translation difference between the armature and the mesh. in otherwords itās not getting the offset.
OK, found 1 problem with the export script, its modifying image names the materials are looking for but not modifying the actual image names to match, it seems to have a max length too so 12 characters including the file extension. However, thatās not the only issue, I caught it renaming short texture names with things like āFace.pngTex.000ā on the model but leaving it as āFace.pngā on the actual file name, and this throws a key error in the importing software because there is no such texture name. so at least I know where to look in the script for these things. Ideasman42 is usually really good about leaving comments, so if itās necessary I can work around it.
I should go over that diff fileās contents before I try anything. the diff file has already been applied to the current 3ds export doc. so at this point Iāll have to monkey with it. given it has no errors on Export, but has errors on Import I can know that a few definitions are already predefined such as;
name_unique = [] # stores str, ascii only
name_mapping = {} # stores {orig: byte} mapping
because at no point in the code does it fill this list and dictionary with info from a given file. therefore the init imports must have information about what to slip in there.
the problem seems to be found at
while new_name in name_unique:
new_name = new_name_clean + ".%.3d" % i
where ānew_nameā at this point has already been converted to ascii and limited to 12 characters. so why on earth itās adding ANYTHING to the file name is beyond me. I mean thatāll just break it.
the order of bends @.@ thats enough for today. names are converted to ascii thrice then get a Tex.00# added onto them, perhaps if the names wereall exactly 12 characters it might work? thats the last thing Iāll try.
Oh I see why everyone gave up. the textures MUST be saved externally in the same folder, but in blender 2.83 the textures are packed into the Shader editor which feeds the outcome to the material. that will definitely make 3ds importers mad as all they want is the actual file location not a node.
Ramblings of a madman
and it looks like you can only actually add 1 texture file for all models in the whole program in 2.83 facepalm. I was trying to replace the packed textures with file locations, but it only accepts 1 file location in the texture buttons, no more, it also does not change when selecting a different model even though I told it to make a single user copy.
this is why I donāt usually work in blender 2.8+⦠things are just difficult.
GAHHHHHHHHHJH all the textures need to be applied from the Shader editor not the textures buttons. no wonder the export script isnāt getting them, the export script is not looking in the Shader editor to grab images⦠and the material does not have direct access to the files, the shader does. which means the export script needs to wrestle that info away from the shader to save the texture file location to the 3ds material. and thats why it keeps complaining. sigh, i have no idea how to get info from the shader by python code.
at this point to make this work because of the changes that were made to the way textures are applied in 2.8+ itād be better for me to abandon the normal export operations built into blenderās code as those are incompatible. instead Iāll have to get the scene list and grab info from things directly that way then fill in the blanks in the script so it knows where to find textures.
Hopefully itās less complicated that I think to merely modify the export script, Iām getting a bit frustrated, especially seeing as itās not even seeing modifications to the script any more. I broke it on purpose to see, and the outcome was the same. so this project will now take a short break while I cool off and do some actual work.
one cooldown later, I need to see if bpy.data.images has the file locations in the data somewhere
it appears it does have it under bpy.types.Image(image ID).filepath , so to get the image ID weāll do
for image in bpy.data.images:
filepath = bpy.types.Image(image).filepath
filename = filepath.split("/")[-1]
thats enough progress for now.
the current issue is blender 2.83 is not seeing changes to the scripts. so, I probably need to uninstall the scripts and reinstall them from the newest modified version. If I have to do that for each revision of the code that could be painful for trial and error.