rename getMeshNames to getChildEntities

This commit is contained in:
Nick Fisher
2024-03-04 21:43:56 +08:00
parent e2a56f4136
commit 5287c108f9
2 changed files with 8 additions and 6 deletions

View File

@@ -597,9 +597,10 @@ abstract class FilamentController {
FilamentEntity parent, String childName);
///
/// Lists all child meshes under the given entity.
/// List all child entities under the given entity.
///
Future<List<String>> getMeshNames(FilamentEntity entity, {bool async = true});
Future<List<String>> getChildEntities(FilamentEntity entity,
{bool renderableOnly = true});
///
/// If [recording] is set to true, each frame the framebuffer/texture will be written to /tmp/output_*.png.

View File

@@ -1436,12 +1436,13 @@ class FilamentControllerFFI extends FilamentController {
return childEntity;
}
Future<List<String>> getMeshNames(FilamentEntity entity,
{bool async = false}) async {
var count = get_entity_count(_sceneManager!, entity, true);
@override
Future<List<String>> getChildEntities(FilamentEntity entity,
{bool renderableOnly = false}) async {
var count = get_entity_count(_sceneManager!, entity, renderableOnly);
var names = <String>[];
for (int i = 0; i < count; i++) {
var name = get_entity_name_at(_sceneManager!, entity, i, true);
var name = get_entity_name_at(_sceneManager!, entity, i, renderableOnly);
if (name == nullptr) {
throw Exception("Failed to find mesh at index $i");
}