View Single Post
10/05/18, 01:06 AM   #7
Cardinal05
AddOn Author - Click to view addons
Join Date: Feb 2018
Posts: 33
Programmatic Access to Query Parent/Child Relationships

The more I am working with the new changes on the PTS, the more I am realizing that we really will need a way to query the relationship between furniture items via the API.

Without methods to determine if a given item has a dependency or dependents, we cannot guarantee to the user that we will be able to move/manage their furniture accurately.

For example, if a user establishes a table as a parent with the surrounding chairs as children, our add-ons should only be moving the parent table item. Additionally, we should also move that table relative to the group as a whole in order to feel intuitive to the user when adjusting the orientation. If a user is rotating the group, they can currently expect that rotate operation to rotate the group around the group's logical center point (as is the case with Essential Housing Tools today).

If we cannot query which items, if any, are parents to any other items in the group, we cannot know whether we should restrict our move operations to the parent items or not; in fact, at this point in time on the PTS, anyone using a Housing add-on will be running a very likely risk of distorting their furniture layouts if they use the add-on to manipulate any group of items that contains parent-child relationships as the add-on will not know which items are the parents.

I hope I have explained this well as we really will need at least a function to identify the Parent of an item and/or the Children of an item (and more ideally, a function that can do this in bulk rather than individual checks - unless there's no server round-trip per call) if our Housing add-ons are to remain viable tools that you can reasonably assume will not "mess up" your house. <3

Thank you so much!
@Cardinal05