#Editing imported meshes with a plugin

28 messages · Page 1 of 1 (latest)

nocturne raft
#

I want to create an editor plugin that would add commands to edit imported meshes, it would automatically apply settings from the advanced import settings window, but I have no idea how to do it in a script.
Like I want to the script access all the materials of the mesh and edit them, set override to true and set path.
How do I do this?

umbral dagger
#

Of simple plugins??

nocturne raft
#

I just need something to know how to do this

#

Nothing about it in documentation, I don't know even how to reference imported mesh stuff in a script, cause it's not just PackedScene, there's some extra dedicated stuff on top of it

nocturne raft
#

The only solution I can think of is directly modifying the .import file but it feels really hacky

nocturne raft
#

So, what formatting do .import files use? Is there simple way to read/modify its property blocks?

umbral dagger
cloud stump
#

Try dig around this plugin

This plugin allows you to edit basic mesh like a cube, to change size, extrude, loop cut and the likes

Its almost like basic blender editing

nocturne raft
#

How do I move a microwave to a pan? @cloud stump

#

@umbral dagger How do I buy a fish?

cloud stump
#

Sorry I was assuming you want to edit the mesh, so I pointed you to ply plugin
If you just want to automate some small work like applying material to mesh on import, that EditorScenePostImport script I link above is the way to do it

#

Of course to use it you need firm understanding of programming since it uses recursive
So good luck

nocturne raft
#

Both people's answers I got looked like coming from bot, they are so random
Anyways, if you're not a bot - this doesn't address my question. I'm making an editor plugin, NOT mesh import script

#

So I need to access mesh import settings from an outside editor script

cloud stump
#

Closest thing i know someone else trying to do that is when they tries to import multiple textures to do texture painting in terrain plugin
And that requires almost wizardy level of code

#

I forgot if they access the import setting or just make their own though

#

Unfortunately its not aligned with your need so I can't recommend you dig the source code

umbral dagger
nocturne raft
umbral dagger
#

Yes

#

Correct answer

#

Hahahahaha

#

Hahaaha

wind basin
#

.import files are ini files

#

so use ConfigFile

#

and there's a reimport function somewhere