User Tools

Site Tools


example.1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

example.1 [2022/05/10 08:39] – [Creating a chair] ig_jscexample.1 [2024/04/04 08:04] (current) – external edit 127.0.0.1
Line 182: Line 182:
 Make sure on the //Settings// page the workspace settings are set up as following: Make sure on the //Settings// page the workspace settings are set up as following:
 {{ ::configuration_settings.png?600 |}} {{ ::configuration_settings.png?600 |}}
 +
 +Also if switching the mode to SimpleCom make sure to click "connect". Changing the dropdown value is not enough.
 +If you are not using a contect script make also sure the "Advanced"->"Commercial context" ist set to "NoContext".
  
 As first the **Chair** should get a property to switch the material. There for go to the //Assets/Commercial// page. For more information on this page, check its [[ig.creator:assets:commercial|Wiki]]. As first the **Chair** should get a property to switch the material. There for go to the //Assets/Commercial// page. For more information on this page, check its [[ig.creator:assets:commercial|Wiki]].
Line 282: Line 285:
 Select the //SeatBack// line and press the right mouse button. Add two child elements. Select the //SeatBack// line and press the right mouse button. Add two child elements.
 {{ ::configuration_18.png?800 |}} {{ ::configuration_18.png?800 |}}
 +The result should look like this:
 +{{ ::configuration_19.png?800 |}}
 +
 +Name the //Description// of the new nodes //SeatBack_A// and //SeatBack_B//.
 +{{ ::configuration_20.png?800 |}}
 +The new nodes will not get a positioon, they inheriate it from the prarent node //o1.o2//
 +
 +As next, go to the //Products/Graphical/Geometry// page and remove the geometry from node //o1.o2//.
 +{{ ::configuration_21.png?800 |}}
 +
 +Add the geometries //SeatBack_A// and //SeatBack_B// to the nodes //o1.o2.o1// and //o1.o2.o2//.
 +{{ ::configuration_22.png?800 |}}
 +
 +For checking, put //SeatBack_B// a little bit higher as //SeatBack_A// and go back to the //Configurator//.
 +{{ ::configuration_23.png?200 |}}
 +
 +The next step is to hide either //SeatBack_A// or //SeatBack_B//. For this, a new property needs to be linked to the geometries. This is done like it has been done with the material befor. Go to //Products/Commercial// and create a new commercial property.
 +{{ ::configuration_24.png?800 |}}
 +In case testing the new property inside the //Configurator// the result is: Nothing has changed. This is because the geometries itself are not connected to the created property yet.
 +
 +Go to //Products/Graphical/Structure// to link the property and the geometries. Have a close look at the table. There should be a column called //Visible//.
 +
 +Take the line with //SeatBack_A// and for the visibility write: **{ComSeatBack==='SeatBack_A'}**
 +
 +This expression is a JavaScript code snippet.
 +Each JavaScript code snippet is written between **{}**. **ComSeatBack** is the property created under //Products/Commercial//. But when using it inside the node structure is gets the prefix **Com**. **SeatBack_A** is the name of the geometry. Notice strings are written in **''** not **""** !
 +{{ ::configuration_25.png?800 |}}
 +
 +Because //Visible// column is asking for a boolean, this line is evaluatoed as //If-statement//. Make //SeatBack_B// configuratable as well and reset the position, so it has the same position like //SeatBack_A//. Test it in the //Configurator//.
 +{{ ::configuration_26.png?400 |}}
 +
 +With this, it is possible to configure the seatback with in two differen variations.
 +
 +As an exercice, add more properties that changes a part of the chair, e.g. the seat or the legs.
 +
  
example.1.1652164748.txt.gz · Last modified: 2024/04/04 08:04 (external edit)