Quick question, I have a project that is over budget. When I enable nanite none of the triangles are adjusting on distance.
I’m using 5.3 and there is no option for “Nanite Tools” under tools which is what is suggest to use in the unreal documentation in order to set Nanite Optimization / Triangle Threshold.
I am unable to optimize or select any of these options as nanite tools is missing
(typically nanite tools falls in between “Merge Actors” and “Project Launcher”
I saw the option for geometry optimization / triangle threshold earlier and now for the life of my spent 3 hours trying to find this one feature that has seemed to disappear from my interface!!
Just popping in to say I have the same issue - can’t use any of my kitbash3D meshes sans manually replacing all the textures unless I can mess with the triangle threshold number under ‘Nanite Tools’ which is not appearing in 5.3
I have the same issue on 5.3. But can you elaborate on your kitbash3d method ? I’m just trying out the free assets for now and noticed that most of them do not accept nanite, even though I enable it on all static meshes. Some are fine but some are very weird looking, like a really low-detail LOD and some parts even disappear completely.
Why are you mentioning replacing the materials ?
I’m just curious because I want to know if I can find workarounds and make it work with Kitbash3D assets or simply look elsewhere.
If someone finds this helpful, here is a python-script, that finds all Static Meshes in your open level and converts them to nanite. It recreates the behavior of the first Nanite Tools. So only Materials with opaque Material get converted. I don’t know who wrote this originally, but here is my version i had laying around:
import unreal
# get all static mesh actors
# get all materials per actor
# confirm blend mode is set to opaque or masked
# get associated static mesh
# enable nanite
def getStaticMeshActors():
"""
Return all static meshes in level.
"""
# classes that inherit from EditorSubsystem need to be instatiated
actors = unreal.EditorActorSubsystem().get_all_level_actors()
staticMeshActors = [actor for actor in actors if isinstance(actor, unreal.StaticMeshActor)]
return staticMeshActors
def evaluateStaticMeshActors():
"""
Get all materials for each static mesh actor and check blend modes.
"""
for staticMeshActor in getStaticMeshActors():
materials = staticMeshActor.static_mesh_component.get_materials()
# confirm materials use valid blend modes
if processMaterials(materials):
# enable nanite
enableNanite(staticMeshActor)
def processMaterials(materials):
"""
Evaluate blend modes on all materials and return 1 if all are valid
"""
validBlendModes = ['OPAQUE', 'MASKED']
blendModes = []
count = 0
# iterate over materials and collect blend mode info
for material in materials:
if isinstance(material, unreal.Material):
blendModes.append(material.get_editor_property('blend_mode'))
if isinstance(material, unreal.MaterialInstanceConstant):
parentMaterial = material.get_base_material()
blendModes.append(parentMaterial.get_editor_property('blend_mode'))
# check to see if valid blend mode in material blend mode
for vbm in validBlendModes:
for bm in blendModes:
if vbm in str(bm):
count += 1
if count == len(materials):
return 1
return 0
def enableNanite(staticMeshActor):
"""
Enable Nanite on static mesh associated with static mesh actor.
"""
staticMesh = staticMeshActor.static_mesh_component.static_mesh
if staticMesh:
# get mesh nanite settings
meshNaniteSettings = staticMesh.get_editor_property('nanite_settings')
if not meshNaniteSettings.enabled:
meshNaniteSettings.enabled = True
# classes that inherit from EditorSubsystem need to be instatiated
unreal.StaticMeshEditorSubsystem().set_nanite_settings(staticMesh,meshNaniteSettings, apply_changes=True)
evaluateStaticMeshActors()
PS: This does not save the Assets. So be shure to do so if you want to keep the changes.