I'm trying to create OBJ's using the python bindings for the procedural runtime. I have 4 shapes and I want different shapes to be generated using different rules defined in my CGA - I would normally do this by setting the startRule as an attribute of the shape.
It seems that pyprt does not support setting a StartRule file anymore? this used to be a parameter that could be set for each shape.
as an example I have:
Using the pyprt I've tried to use the shape attributes for this:
shape_attributes = [
{'shapeName': 'left_lot', 'seed': seed, "startRule": "Lots"},
{'shapeName': 'left_sidewalk', 'seed': seed, "startRule": "Sidewalks"},
{'shapeName': 'street', 'seed': seed, "startRule": "Street"},
{'shapeName': 'right_sidewalk', 'seed': seed, "startRule": "Sidewalks"},
{'shapeName': 'right_lot', 'seed': seed, "startRule": "Lots"}
]
#prt_shapes is a list containing 5 pyprt shapes
model_generator = pyprt.ModelGenerator(prt_shapes)
#my rpk with the different rules which I want to use as startRules
rpk = os.path.join(cwd, 'model.rpk')
encoder = 'com.esri.prt.codecs.OBJEncoder'
encoder_options = {
'meshGranularity': 'AS_GENERATED',
'vertexNormals': 'SET_ALL',
'baseName': "street",
'outputPath': cwd
}
generated_models = model_generator.generate_model(
shape_attributes,
rpk,
encoder,
encoder_options
)
When I run this, all models are generated using the default StartRule defined in my CGA rather than the one specified by the shape parameters.