Is there a way to change the parent material of multiple material instance all at once? For example, I have 50 material instances and I want them to all have the same parent material.
I have tried scripting it with a blueprint but havent had any luck.
Be careful: this doesnāt have any check inside it, be sure to select the correct materials and the correct parent path!
Always try with a single asset before running a batch!
Did you set the correct path in ādefault_material_pathā (it has to be the parent material path).
Are you selecting the materials instances to reparent when launching the python script?
That error really doesnāt ring me any bell, Iād make a plugin in C++ and share it with you but right now Iām pretty busy, sorry
MaterialReparenterUndo.zip (509.0 KB) (Safer)
Mark the assets as modified (and you can undo the operation with CTRL+Z), you need to save them manually to make the edit permanent.
OMG Thanks for the plugin!!
Btw, did you use āSetParentInternalā c++ function for this plugin?
I really want to know what caused the crash, and if you share c++ code for me, it would be also greatfulā¦
Yeah! I checked the BP you gave to me
The reason why crash occured was because I did not access to material directly, but access it via static mesh actor. Not 100% sure, but the BP you made didnāt occur the crash.
Iām sorry that I did not post the original question, so I cannot mark the solutionā¦
Truly thank u for solving the problem, thanks for spending your precious time for me, you made my day
Remember, if thereās the word āactorā it means that they are placed in world, if you have to access assets in editor you need to cast āselected assetā to its specific class and then use the function that you need (in this case to replace the parent)
Oh, Iām sorry, I didnāt notice it.
Donāt worry, I flagged the post and a mod has already marked it for you!
You are very welcome, Iām happy that it worked and I shared it because I think it could be useful to other useful to other users in the future (because this is an issue that could occur very easily).
Thatās why imho itās important to āmark a thread as solvedā, when Iām looking for a solution I try to avoid posts that donāt have one (sometimes they can point you the right direction where to look but you have to find a way by yourself!)
Has anyone gotten the plugin from @Ares9323 to work with material instances/interfaces as the parent? Nearly every time I try it with those my editor crashes.
Which engine version are you using?
Have you tried using it with few instances at a time? (There could be an issue with some material in particular that may cause your crashes)
Thatās good to know, but knowing Unreal I would have expected something similar
Probably, thereās a way to automatically close windows of instances before doing the replace but I didnāt think about that when I posted it (because it was a simple script made to help the OP).
Itās always better to close editor windows when you are renaming/moving/replacing stuff (and donāt forget to use āFix Up Redirectorsā after moving files, especially if they have references and youāre using source control)