@@ -45,15 +45,23 @@ SceneObjectInstanceAttributes::SceneObjectInstanceAttributes(
45
45
const std::string& handle,
46
46
const std::shared_ptr<AbstractObjectAttributes>& baseObjAttribs)
47
47
: SceneObjectInstanceAttributes(handle) {
48
+ // This constructor is for internally generated SceneObjectInstanceAttributes,
49
+ // to correspond to an object that is being created programmatically and saved
50
+ // to a scene instance.
51
+ // Handle is set via init in base class, which would not be written out to
52
+ // file if we did not explicitly set it.
53
+ setHandle (handle);
48
54
// set appropriate fields from abstract object attributes
49
55
// Not initialize, since these are not default values
50
56
set (" shader_type" , getShaderTypeName (baseObjAttribs->getShaderType ()));
51
57
// set to match attributes setting
52
58
set (" is_instance_visible" , (baseObjAttribs->getIsVisible () ? 1 : 0 ));
59
+
53
60
// set nonuniform scale to match attributes scale
54
61
setNonUniformScale (baseObjAttribs->getScale ());
55
62
// Prepopulate user config to match baseObjAttribs' user config.
56
- overwriteWithConfig (baseObjAttribs->getUserConfiguration ());
63
+ editUserConfiguration ()->overwriteWithConfig (
64
+ baseObjAttribs->getUserConfiguration ());
57
65
}
58
66
59
67
std::string SceneObjectInstanceAttributes::getObjectInfoHeaderInternal () const {
@@ -180,9 +188,13 @@ SceneAOInstanceAttributes::SceneAOInstanceAttributes(const std::string& handle)
180
188
SceneAOInstanceAttributes::SceneAOInstanceAttributes (
181
189
const std::string& handle,
182
190
const std::shared_ptr<ArticulatedObjectAttributes>& aObjAttribs)
183
- : SceneObjectInstanceAttributes(handle, " SceneAOInstanceAttributes" ) {
184
- // initialize default auto clamp values (only used for articulated object)
185
- init (" auto_clamp_joint_limits" , false );
191
+ : SceneAOInstanceAttributes(handle) {
192
+ // This constructor is for internally generated SceneAOInstanceAttributes, to
193
+ // correspond to an object that is being created programmatically and saved to
194
+ // a scene instance.
195
+ // Handle is set via init in base class, which would not be written out to
196
+ // file if we did not explicitly set it.
197
+ setHandle (handle);
186
198
187
199
// Should not initialize these values but set them, since these are not
188
200
// default values, but from an existing AO attributes.
@@ -197,10 +209,10 @@ SceneAOInstanceAttributes::SceneAOInstanceAttributes(
197
209
setLinkOrder (getAOLinkOrderName (aObjAttribs->getLinkOrder ()));
198
210
// Set render mode to use aObjAttribs value
199
211
setRenderMode (getAORenderModeName (aObjAttribs->getRenderMode ()));
200
- // set appropriate values to match values in aObjAttribs
201
- setMassScale (aObjAttribs->getMassScale ());
212
+
202
213
// Prepopulate user config to match attribs' user config.
203
- overwriteWithConfig (aObjAttribs->getUserConfiguration ());
214
+ editUserConfiguration ()->overwriteWithConfig (
215
+ aObjAttribs->getUserConfiguration ());
204
216
editSubconfig<Configuration>(" initial_joint_pose" );
205
217
editSubconfig<Configuration>(" initial_joint_velocities" );
206
218
}
0 commit comments