Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Use Attributes to update a surface shape's 3d view representation

Use Attributes to update a surface shape's 3d view representation

Anonymous
Not applicable
449 Views
1 Reply
Message 1 of 2

Use Attributes to update a surface shape's 3d view representation

Anonymous
Not applicable

Hi,

 

Problem:

 

I am trying to work out how to alter the 3DView representation of an MPxSurfaceShape derived custom object. In this case a cameras bounding frustrum. It should work like the Grid helper model shown via Show->Grid option, which isn't selectable or affected in any way other than through some preference width/height attributes.

 

Attempt 1:

 

Altering MPxSurfaceShape::mControlPoints directly via a set of custom attributes.

 

The control points should be alterable using custom attributes width, height, near and far clip planes.

 

I am able to get the SetDependentsDirty to trigger when I change one of the attributes, I then mark the mControlPoints as being affected by this change. At this point I cannot get the compute method to fire, the compute method being the place I update the mControlPoints with the offsets from the updated attributes.

 

Do I need to manually mark the mControlPoints as being dirty somehow, as well as adding it into the affectedPlugs in the setDependentsDirty call?

 

Attempt 2:

 

I am in the process of creating a deformer. This seems like overkill for a shape whose 3D model I am not going to allow the user to manipulate in any other way than through the shape custom attributes. i.e. its a static helper shape.

 

 

Can anyone clue me in to the best way to go about editing my shapes 3d view.

 

Thanks.

0 Likes
450 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Do not you miss attributeAffects(....) for that one?

0 Likes