mirror of
https://github.com/solero/houdini.git
synced 2024-11-12 13:48:20 +00:00
Add support for Location objects in converter syntax
This commit is contained in:
parent
361bcced50
commit
993ab2ba69
@ -295,6 +295,17 @@ class FlooringConverter(IConverter):
|
||||
return None
|
||||
|
||||
|
||||
class LocationConverter(IConverter):
|
||||
|
||||
description = """Converts a location ID into a houdini.data.Location instance"""
|
||||
|
||||
async def convert(self, ctx):
|
||||
location_id = int(ctx.argument)
|
||||
if location_id in ctx.p.server.locations:
|
||||
return await ctx.p.server.locations.get(location_id)
|
||||
return None
|
||||
|
||||
|
||||
class StampConverter(IConverter):
|
||||
|
||||
description = """Converts a stamp ID into a houdini.data.Stamp instance"""
|
||||
@ -396,6 +407,7 @@ ConverterTypes = {
|
||||
Furniture: FurnitureConverter,
|
||||
Igloo: IglooConverter,
|
||||
Flooring: FlooringConverter,
|
||||
Location: LocationConverter,
|
||||
Stamp: StampConverter
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user