LogoLogo
  • Seahaven
    • Seahaven Documentation
      • Set Up Your Account
      • Getting Started
        • Prepare Your Models
          • Name Objects
          • Add Camera Curve to a scene
        • Import 3D Assets
        • Relationship Editor
          • Workflow
          • Relationship
          • Relationship (Array)
          • Relationships
            • Placements
            • Locate
            • Rotate
            • Neighbour
            • Drop
            • Center
            • Scale
            • Align
            • Attach
            • Put
        • Simulation Editor
          • Workflow
          • Scene
            • 3D Asset
            • HDRI Lighting
            • Physical Sun/Sky
            • Ground Plane
            • Interior Scene
            • Room Type
          • Relationships
            • Load Relationships
          • Camera
            • Camera Configuration
            • Animated Track Camera
            • Curve-Based Camera
            • Room-Perimeter Camera
              • Category
            • Room-Based Camera
              • Additional Cameras
            • Position Camera
              • Conical
              • Spherical
              • Cubic
            • Orientation
              • Calculate Area of Interest
              • Point
            • Perspectival Camera Properties
            • Fisheye Camera Properties
          • Manipulators
            • Camera Manipulators
              • Override Camera Target
              • Override Camera Position
              • Near IR (Approximation)
              • Track Camera to Object
                • Camera Path Settings
            • Light Manipulators
              • Randomize HDRI Background
              • Modify Light Strength
              • Place Lights
                • Light Object (Bbox)
                • Light Object (Polar)
            • Material Manipulators
              • Randomize Material Color
              • Randomize Material Properties
              • Swap Materials
                • Import Material
                • Replace Material
                • Weighted Material
            • Delete Objects by Name
            • Filter Objects/Annotations
            • Pose Objects
              • Pose Set
              • Pose Pair
            • Constrain Object
            • Add Particle System
            • Load Object Along Curve
            • Replace
              • View settings
              • Load child object
          • Render Passes
            • RGB Image
              • Compositing
                • Blur
                • Shot Noise
                • Glare
                • Thermal
            • RGB Image (No Shadow)
            • RGB Image (Isolated Foreground)
            • Segmentation Map
            • Thermal Image
            • Depth Pass
            • Normals
            • Binary Segmentation
              • Material-Based Segmentation
              • Compositing-Based Segmentation
          • Output Files
            • COCO Annotations
            • Keypoints
            • Camera Ex/Intrinsics
        • Running Simulation
        • Save and Import
    • Seahaven Tutorials
    • Errors and Alerts
  • Simulation Manager
    • Simulation Manager
  • Simulation API
    • Simulation Structure
      • YAML Export
      • Sample Configuration
  • Management API
    • Python Package
      • Installation
      • Merge Datasets
      • Methods
      • Dataset Analysis
      • Compression Artifacts
      • Domain Matching
      • Credentials
  • API Tutorials
    • Residential Interior Simulation
      • Upload Your Placement Rules
      • Modifying Your Camera
      • Modify Placement Rules
      • Run your Simulation
      • Tutorial Materials
        • Pipeline Configuration
        • Placement Rules
          • bedroom1.yaml
          • bedroom2.yaml
          • livingroom.yaml
          • floorPlan.yaml
Powered by GitBook
On this page
Export as PDF
  1. API Tutorials
  2. Residential Interior Simulation

Modify Placement Rules

PreviousModifying Your CameraNextRun your Simulation

Last updated 3 years ago

CtrlK

It will sometimes be necessary to change the placement rules or make new ones. For example, you might want to generate specific events and/or edge conditions. In this example, we will place a lamp near the credenza.

To accomplish this we will add a new rule. It is best to think about the placement rules a list of possible conditions that will execute if appropriate. Whether or not a rule is executed depends on various conditions, such as the size of the room and whether or not other rules are executed that a particular rule might be dependent on.

The rules start by defining a "parent" and "child"

        "parent": {"name": "credenza"},
        "child": {"category": "lamp"},

In this case, a credenza must be placed before the lamp. If we didn't want the lamp to have any dependency we could for example, "parent" the object to an architectural feature such as a wall.

Next, we will want to declare settings and rules. In this tutorial, we will not configure any settings for this relationship. We do cover the available options in the "placement.PlacementHandler" portion of the documentation.

        "rules": [
            ["neighbour", {"side": "left", "offset": [0.1, 0.3]}]
        ]

In this case, we only want one rule. We want to place the lamp to the "left" of the credenza between 0.1M and 0.3M away from the object.

Putting it all together your rule looks like this.

You will see in the following image that a lamp is now on the floor next to the credenza.

    {
        "parent": {"name": "credenza"},
        "child": {"category": "lamp"},
        "settings":{},
        "rules": [
            ["neighbour", {"side": "right", "offset": [0.1, 0.3]}]
        ]
    }