Skip to content

Enhance Tree Command with Transform Data and Advanced Filtering#4

Merged
great-majority merged 3 commits into
mainfrom
enhance/shallow-tree
Jun 28, 2025
Merged

Enhance Tree Command with Transform Data and Advanced Filtering#4
great-majority merged 3 commits into
mainfrom
enhance/shallow-tree

Conversation

@great-majority

Copy link
Copy Markdown
Owner

This PR significantly enhances the tree command with comprehensive transform information and advanced filtering capabilities for better performance and flexibility when working with
complex scenes.

What's Added

🔧 Transform Information

  • Position, rotation, and scale data - All objects now include complete transform information in the response
  • Comprehensive object details - Enhanced object metadata for better scene understanding

🎯 Depth Limiting

  • Configurable depth parameter - Limit hierarchy traversal to specific levels (e.g., depth: 2 for root + immediate children)
  • Performance optimization - Avoid deep recursion in complex scenes with many nested objects
  • Backward compatibility - Default behavior unchanged when no depth specified

🔍 Subtree Filtering

  • Object ID targeting - Retrieve only the subtree starting from a specific object (id: 12345)
  • Efficient partial retrieval - Focus on specific parts of large scenes without downloading entire hierarchy
  • Error handling - Proper error responses when specified object ID doesn't exist

📚 Enhanced Documentation

  • Comprehensive examples - Updated both English and Japanese documentation with all new features
  • Clear parameter explanations - Detailed usage instructions for all new parameters

API Examples

// Get full scene (unchanged default behavior)
{"type": "tree"}

// Limit to 2 levels deep
{"type": "tree", "depth": 2}

// Get subtree from specific object
{"type": "tree", "id": 12345}

// Combined: specific object, limited depth
{"type": "tree", "id": 12345, "depth": 1}

Response Format Enhancement

Before:

{
  "name": "Object Name",
  "objectInfo": {"id": 12345, "type": "OCIItem"},
  "children": [...]
}

After:

{
  "name": "Object Name",
  "objectInfo": {
    "id": 12345,
    "type": "OCIItem",
    "transform": {
      "pos": [0.0, 1.0, 0.0],
      "rot": [0.0, 90.0, 0.0],
      "scale": [1.0, 1.0, 1.0]
    },
    "itemDetail": {"group": 0, "category": 1, "itemId": 5}
  },
  "children": [...]
}

Benefits

  • 🚀 Performance - Dramatically faster for large scenes with depth/ID filtering
  • 💾 Bandwidth - Reduced payload sizes when only partial data needed
  • 🔧 Integration - Better support for external tools that need specific object information
  • 🔄 Compatibility - Fully backward compatible with existing implementations

This enhancement maintains complete backward compatibility while providing powerful new capabilities for efficiently working with complex Studio scenes.

…rees

- Added functionality to retrieve a subtree starting from a specific object ID if provided.
- If the ID is not specified, the command defaults to returning all root objects.
- Updated TreeCommand class to include an optional 'id' property for specifying the object ID.
- Added error handling for cases where the specified object ID does not exist.
@great-majority great-majority self-assigned this Jun 28, 2025
@great-majority great-majority merged commit 31bc114 into main Jun 28, 2025
3 checks passed
@great-majority great-majority deleted the enhance/shallow-tree branch June 28, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant