SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SHIII Mods Workshop
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 12-11-24, 04:36 PM   #14
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,656
Downloads: 137
Uploads: 0


Default

Got the Script that will move an object and rotate it in degrees figured out.
And a batch import handled.

Now I have to keep studying to figure out how to apply any transforms to objects by name after they are imported.
Still learning the Blender Python APIs

What I want to do is after a batch import, run the script to adjust the objects by name.
So if theres 200 objects they all would be moved and rotated based on what the script provides.

Oh yeah. I can only run Blender 2.79 since I still work with WhinDoz 7
Until I get a New system I could probably load a newer version on SWMBO's WhinDoz 11 contraption.
It's got a Killer Ryzen 7 CPU!

So here's a starter script I run in Blender 2.79 to mass import. I'll be working on that to do any transforms as objects are imported.


Code:
import bpy
import glob
import os    
    
importDir = "E:\\Desktop\\3D\ "
print(importDir)


os.chdir(importDir)
for files in glob.glob("*.obj"):
    print( files )
    bpy.ops.import_scene.obj(filepath=files, filter_glob="*.obj;*.mtl")
That Script imports every object that I exported from the Harbor_Kit.dat!
Now I just have to intercept each object and apply the Transition code stuff as it imports.

Guess I'll have to kind of load a Newer Blender on SWMBO's 'Puter and test it?
Unless a kind person does it for me? You can change the importDir to whatever works for you.

Last edited by Jeff-Groves; 12-11-24 at 06:14 PM.
Jeff-Groves is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.