Skip to content

Commit

Permalink
updated groom extension and extension docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-yao91 committed Aug 7, 2024
1 parent e31c43f commit d48dfd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 4 additions & 6 deletions docs/send2ue/customize/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,9 @@ There is a submodule within `send2ue` that can be used to make your own rpc call
a basic example of how you can force an asset to be renamed in the `post_import` method of an extension.
```python
from send2ue.core.extension import ExtensionBase
from send2ue.dependencies.unreal import remote_unreal_decorator
from send2ue.dependencies.rpc.factory import make_remote


@remote_unreal_decorator
def rename_unreal_asset(source_asset_path, destination_asset_path):
if unreal.EditorAssetLibrary.does_asset_exist(destination_asset_path):
unreal.EditorAssetLibrary.delete_asset(destination_asset_path)
Expand All @@ -343,11 +342,10 @@ class ExampleExtension(ExtensionBase):
name = 'example'
def post_import(self):
asset_path = self.asset_data[self.asset_id]['asset_path']
rename_unreal_asset(asset_path, f'{asset_path}_renamed_again')
remote_rename_unreal_asset = make_remote(rename_unreal_asset)
remote_rename_unreal_asset(asset_path, f'{asset_path}_renamed_again')
```
Notice how you can define remote unreal functions on the fly by just wrapping your function
with the `remote_unreal_decorator`. The RPC library has a factory that takes care of teleporting
your code and imports over to the open unreal editor.
Notice how you can define remote unreal functions on the fly by just passing a function reference to the `make_remote` function. The RPC library has a factory that takes care of teleporting your code and imports over to the open unreal editor.

!!! note

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from send2ue.core.extension import ExtensionBase
from send2ue.core import utilities
from send2ue.constants import UnrealTypes
from send2ue.dependencies.unreal import UnrealRemoteCalls
from send2ue.dependencies.unreal import UnrealRemoteCalls as UnrealCalls
from send2ue.dependencies.rpc.factory import make_remote

UnrealRemoteCalls = make_remote(UnrealCalls)


class CreatePostImportAssetsForGroom(ExtensionBase):
Expand Down

0 comments on commit d48dfd0

Please sign in to comment.