I've tried passing an SFString into a prototype and using that to control
the name of a viewpoint created within the prototype, so that I don't end
with many different viewpoints all with the same name.
I've tried using the following code:
######################################### car.wrl
PROTO Car [
exposedField SFString view_name "Inside"
]
{
....
Transform {
rotation 0 1 0 -1.571
children [
Transform {
rotation 0 1 0 -1.541
translation -15 5 0
children [
Viewpoint {
description IS view_name <------ IS statement:
category mismatch
orientation 0 0 0 0
position 0 0 0
}
]
}
]
}
....
}
######################################### main.wrl
EXTERNPROTO Car [
exposedField SFString view_name
]"car.wrl#Car"
...
Transform {
rotation 0 1 0 3.142
children [
Car {
view_name "A"
}
]
}
Transform {
rotation 0 1 0 3.142
children [
Car {
view_name "B"
}
]
}
But it does not work and produces these errors:
Error in definition of PROTO Lego_Car
<file>...\car.wrl#car : IS statement: category mismatch
Does anyone have any ideas why this does not work?
Cheers.
|