mirror of
https://github.com/solero/houdini.git
synced 2024-12-23 14:03:38 +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
|
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):
|
class StampConverter(IConverter):
|
||||||
|
|
||||||
description = """Converts a stamp ID into a houdini.data.Stamp instance"""
|
description = """Converts a stamp ID into a houdini.data.Stamp instance"""
|
||||||
@ -396,6 +407,7 @@ ConverterTypes = {
|
|||||||
Furniture: FurnitureConverter,
|
Furniture: FurnitureConverter,
|
||||||
Igloo: IglooConverter,
|
Igloo: IglooConverter,
|
||||||
Flooring: FlooringConverter,
|
Flooring: FlooringConverter,
|
||||||
|
Location: LocationConverter,
|
||||||
Stamp: StampConverter
|
Stamp: StampConverter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user