Transitioning from Pre-1.12.0 InlineDrawing¶
バージョン 1.12.0 で追加.
Prior to version 1.12.0 the InlineDrawing type was used to create shapes and draw content into them. This is quite different to the functionality provided with 1.12.0. However there is an easy path for transition. Previously code would look like this:
InlineDrawing draw = InlineDrawing();
InlineShape shape = draw.getNewShape('debug');
shape.drawTrianglesSphere(Xfo(), 2.0, 12);
draw.drawShape('debug', Xfo(), Color(1.0, 0.0, 0.0));
All of the methods of the previous InlineShape are now provided on the InlineDebugShape (object), so all of that code can be transitioned to use that type instead:
InlineDrawing draw = handle.getDrawing();
InlineDebugShape shape = draw.registerShape(InlineDebugShape('debug'));
shape.drawTrianglesSphere(Xfo(), 2.0, 12);
InlineShader flat = draw.registerShader(OGLFlatInlineShader());
InlineMaterial red = flat.getOrCreateMaterial('red');
red.addInstance(SimpleInlineInstance('redSphere', draw.getTransform(), shape));
注釈
Instances, Materials etc build up in the drawing main container. Catch your scene building code in an if statement, or reset the drawing prior to building the scene.