This is probably a question best-suited to matthias....but here is a shot at your answer:1) I think this has to do with how CityEngine reads rule hierarchy. Ie, instead of proceeding from one line in the rule down to the next (which is how I conceptualize coding), it proceeds from one rule (in its entirety) to the next. In your case, then, you would have to separate it out:Start -->
alignScopeToAxes(y)
s(assetSize("assets/facades/gazeboBeam_1.obj", "x"),assetSize("assets/facades/gazeboBeam_1.obj", "y"),assetSize("assets/facades/gazeboBeam_1.obj", "z"))
i("assets/facades/gazeboBeam_1.obj")
posCheck
posCheck -->
case pos == "center_xz":
center(xz)
case pos == "right":
t('scope.sx - (assetSize("assets/facades/gazeboBeam_1.obj", "x") / 2), 0, 0)
else:
DoNothing
Alternatively, you could repeat the first bit of code after each conditional statement: case pos == "center_xz":
alignScopeToAxes(y)
s(assetSize("assets/facades/gazeboBeam_1.obj", "x"),assetSize("assets/facades/gazeboBeam_1.obj", "y"),assetSize("assets/facades/gazeboBeam_1.obj", "z"))
i("assets/facades/gazeboBeam_1.obj")
center(xz)
....etc
2) If you don't include an else statement, then the conditional remains open. Ie, everything after your last line is still part of the "case" - right? Adding in the "DoNothing" rule as you did is one solution, as is simply using NIL.And for the record, every conditional always includes some sort of "else" condition....otherwise there wouldn't be a conditional to begin with 😉