Class: ModraUp::RenderingOptions
- Inherits:
-
ModraUp::Entity
- Object
- ModraUp::Entity
- ModraUp::RenderingOptions
- Includes:
- Enumerable
Overview
The display style of the model (line style, surface, background, section plane, X-ray, etc.) is stored and retrieved in the form of a key-value table. It is obtained from ModraUp::Model#rendering_options, with one set per model. The keys and value types match those in SketchUp 2026, and changes are saved with the model (OSK3D 23+).
Currently, the viewport will draw: surface style (RenderMode / Texture / ModelTransparency), line display, outline, extension lines, endpoints, jitter, depth cues, back edges, various colors, ground/sky, section plane display, hidden geometry, environmental light shading, etc. Keys for fog, dimension/text display switches, and component editing transparency can be read and written but do not affect rendering at this time.
Constants # collapse
- ModraUp::RenderingOptions::ROPAssign
ROPAssign = 0
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged’s type, with the value being the same as in SketchUp.
- ModraUp::RenderingOptions::ROPDrawHidden
ROPDrawHidden = 28
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPDrawHiddenGeometry
ROPDrawHiddenGeometry = 29
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPDrawHiddenObjects
ROPDrawHiddenObjects = 30
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPEditComponent
ROPEditComponent = 31
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSectionDisplayTurnedOff
ROPSectionDisplayTurnedOff = 27
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a value identical to SketchUp's.
- ModraUp::RenderingOptions::ROPSetAOColor
ROPSetAOColor = 76
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetAOColorEnabled
ROPSetAOColorEnabled = 75
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetAODistance
ROPSetAODistance = 72
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetAOEnabled
ROPSetAOEnabled = 71
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetAOIntensity
ROPSetAOIntensity = 74
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetAOMultiplier
ROPSetAOMultiplier = 73
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as SketchUp.
- ModraUp::RenderingOptions::ROPSetBackgroundColor
ROPSetBackgroundColor = 12
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a value identical to SketchUp.
- ModraUp::RenderingOptions::ROPSetConstructionColor
ROPSetConstructionColor = 15
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetDepthQueEdges
ROPSetDepthQueEdges = 33
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetDepthQueWidth
ROPSetDepthQueWidth = 35
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetDisplayColorByLayer
ROPSetDisplayColorByLayer = 16
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as SketchUp.
- ModraUp::RenderingOptions::ROPSetDisplayDims
ROPSetDisplayDims = 59
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetDisplayFog
ROPSetDisplayFog = 20
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetDisplayInstanceAxes
ROPSetDisplayInstanceAxes = 11
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetDisplaySketchAxes
ROPSetDisplaySketchAxes = 39
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetDisplayText
ROPSetDisplayText = 58
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetDisplayWatermarks
ROPSetDisplayWatermarks = 61
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetDrawBackEdges
ROPSetDrawBackEdges = 63
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetDrawGround
ROPSetDrawGround = 55
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetDrawHorizon
ROPSetDrawHorizon = 54
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetDrawUnderground
ROPSetDrawUnderground = 56
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetEdgeColorMode
ROPSetEdgeColorMode = 5
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetEdgeDisplayMode
ROPSetEdgeDisplayMode = 4
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetEdgeType
ROPSetEdgeType = 41
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged’s type, with the value being the same as in SketchUp.
- ModraUp::RenderingOptions::ROPSetExtendEdges
ROPSetExtendEdges = 8
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as SketchUp.
- ModraUp::RenderingOptions::ROPSetExtendLines
ROPSetExtendLines = 18
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetFaceColor
ROPSetFaceColor = 40
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a value identical to SketchUp's.
- ModraUp::RenderingOptions::ROPSetFaceColorMode
ROPSetFaceColorMode = 9999
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetFogColor
ROPSetFogColor = 23
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetFogDist
ROPSetFogDist = 24
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetFogHint
ROPSetFogHint = 25
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetFogUseBkColor
ROPSetFogUseBkColor = 60
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as SketchUp.
- ModraUp::RenderingOptions::ROPSetForegroundColor
ROPSetForegroundColor = 13
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetGroundColor
ROPSetGroundColor = 53
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetGroundTransparency
ROPSetGroundTransparency = 57
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetHideConstructionGeometry
ROPSetHideConstructionGeometry = 51
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetHighlightColor
ROPSetHighlightColor = 14
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a numeric value identical to SketchUp.
- ModraUp::RenderingOptions::ROPSetHorizonColor
ROPSetHorizonColor = 70
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetJitterEdges
ROPSetJitterEdges = 6
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetLineEndEdges
ROPSetLineEndEdges = 34
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetLineEndWidth
ROPSetLineEndWidth = 36
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetLineExtension
ROPSetLineExtension = 19
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetLineStyleEdges
ROPSetLineStyleEdges = 7
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetLockedColor
ROPSetLockedColor = 38
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetMaterialTransparency
ROPSetMaterialTransparency = 43
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetModelTransparency
ROPSetModelTransparency = 42
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetPhotomatchBackgroundOpacity
ROPSetPhotomatchBackgroundOpacity = 65
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetPhotomatchDrawBackground
ROPSetPhotomatchDrawBackground = 64
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetPhotomatchDrawOverlay
ROPSetPhotomatchDrawOverlay = 66
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetPhotomatchOverlayOpacity
ROPSetPhotomatchOverlayOpacity = 67
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetProfileEdges
ROPSetProfileEdges = 9
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetProfileWidth
ROPSetProfileWidth = 10
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a numerical value identical to SketchUp.
- ModraUp::RenderingOptions::ROPSetProfilesOnlyEdges
ROPSetProfilesOnlyEdges = 37
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetRenderMode
ROPSetRenderMode = 1
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a value identical to SketchUp.
- ModraUp::RenderingOptions::ROPSetSectionActiveColor
ROPSetSectionActiveColor = 44
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetSectionCutFilled
ROPSetSectionCutFilled = 50
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetSectionCutWidth
ROPSetSectionCutWidth = 49
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetSectionDefaultCutColor
ROPSetSectionDefaultCutColor = 46
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetSectionDefaultFillColor
ROPSetSectionDefaultFillColor = 47
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetSectionDisplayMode
ROPSetSectionDisplayMode = 26
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.
- ModraUp::RenderingOptions::ROPSetSectionInactiveColor
ROPSetSectionInactiveColor = 45
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetSkyColor
ROPSetSkyColor = 52
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetTexture
ROPSetTexture = 3
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPSetTransparencyObsolete
ROPSetTransparencyObsolete = 2
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value being the same as in SketchUp.
- ModraUp::RenderingOptions::ROPSetXRayOpacity
ROPSetXRayOpacity = 62
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
- ModraUp::RenderingOptions::ROPTransparencySortMethod
ROPTransparencySortMethod = 32
ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.
Instance Method Summary # collapse
-
#[] ⇒ Boolean, Integer, Float, ModraUp::Color, nil
Read an option. Boolean, integer, float, or ModraUp::Color; return nil for an unknown key.
-
#[]= ⇒ Object
Set an option and refresh the viewport; the value must actually change to dispatch ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged (type as the corresponding ROP… constant). Colors can be ModraUp::Color, color names, or [r, g, b(, a)].
-
#hatch_pattern ⇒ ModraUp::HatchPatternData
Read the default section hatch pattern of the style: the section area without any groups, components, materials, or section plane patterns uses it.
-
#hatch_pattern=(data) ⇒ ModraUp::HatchPatternData
Sets the default hatch pattern for the style (also setting the hatch color).
-
#keys ⇒ Array<String>
All key names (sorted alphabetically).
-
#each ⇒ nil
Yield each key and value.
-
#each_pair ⇒ nil
Like #each_pair.
-
#each_key ⇒ nil
Yield each key name individually.
-
#length ⇒ Integer
Number of options.
-
#size ⇒ Integer
Same as #length.
-
#add_observer(observer) ⇒ Boolean
Register a ModraUp::RenderingOptionsObserver. Adding the same object a second time returns false.
-
#remove_observer(observer) ⇒ Boolean
Remove the observer.
Inherited from ModraUp::Entity
-
#typename ⇒ String
Type name (e.g., Face / Edge / Group).
-
#entityID ⇒ Integer
Entity ID within the current session: A small integer starting from 1 that increments and remains constant for the lifetime of the entity, unchanged by undo/redo operations. This ID is not preserved when saving the file; it will be renumbered upon reopening the model. For cross-session identification, use #persistent_id. Copied entities will receive new IDs.
-
#persistent_id ⇒ Integer
Number assigned with the model: A unique, incrementing small integer starting from 1 that persists across model saves and reloads, independent of #entityID. Copied entities receive new numbers, and deleted entities do not reuse their numbers. Edges, faces, vertices, curves, groups, component instances/definitions, dimensions, leader lines/points, section planes, materials, layers, layer folders, and drawing sheets have assigned numbers; all others (rings, EdgeUses, attribute dictionaries, line types, sets, etc.) return 0.
-
#parent ⇒ ModraUp::Model, ModraUp::ComponentDefinition
Returns the owner of this drawing context. At the root this is the model. Inside a definition it is the definition itself.
-
#model ⇒ ModraUp::Model
The model it belongs to.
-
#to_s ⇒ String
String form. Returns "#<Deleted Entity>” when the entity has been deleted.
-
#inspect ⇒ String
Same as #to_s.
-
#attribute_dictionaries ⇒ ModraUp::AttributeDictionaries, nil
Collection of attribute dictionaries. Returns nil (evaluates to false) if there are no dictionaries.
-
#attribute_dictionary(name) ⇒ ModraUp::AttributeDictionary, nil
Retrieve an attribute dictionary by name. If none exists, return nil; if create is true, create an empty dictionary. ModraUp::Loop / ModraUp::EdgeUse / ModraUp::Curve always return nil.
-
#valid? ⇒ Boolean
Returns true if the entity is valid, meaning it has not been deleted from the model. Revoked entities are false; even if new geometry is drawn occupying its original position, this object remains an invalid entity (still false). Repeating the action to restore it makes it valid again.
-
#deleted? ⇒ Boolean
Opposite of #valid?.
-
#set_attribute(dict_name, key, value) ⇒ Object
Write attribute values. Materials, groups, component instances, faces, and edges are supported. When dict_name and key are Symbols, they are converted to strings. The type of data written is the same type that will be read back.
-
#get_attribute(dict_name, key, default = nil) ⇒ Object
Read the attribute. If dict_name and key are Symbols, convert them to strings (similar to SketchUp). If the dictionary or key does not exist, return default. The return value type is the same as what is written by #set_attribute.
-
#delete_attribute(dict_name) ⇒ Boolean
Delete a key, or delete the entire dictionary when the key is omitted.
Instance Method Details
rendering_options[key] ⇒ Object or nil
Read an option. Boolean, integer, float, or ModraUp::Color; return nil for an unknown key. RenderMode: 0 wireframe, 1 hidden-surface, 2 shaded (whether to show textures depends on Texture), 5 solid. EdgeColorMode: 0 by material, 1 uniform, 2 by axis.
rendering_options[key] = value ⇒ value
Set an option and refresh the viewport; the value must actually change to dispatch ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged (type as the corresponding ROP… constant). Colors can be ModraUp::Color, color names, or [r, g, b(, a)].
#hatch_pattern ⇒ ModraUp::HatchPatternData
Read the default section hatch pattern of the style: the section area without any groups, components, materials, or section plane patterns uses it. The returned object is frozen; to modify it, first dup it and then assign it back. The fill color is the style's section fill color.
#hatch_pattern=(data) ⇒ ModraUp::HatchPatternData
Sets the default hatch pattern for the style (also setting the hatch color).
rendering_options.keys ⇒ Array<String>
All key names (sorted alphabetically).
rendering_options.each { |key, value| ... } ⇒ nil
Yield each key and value.
rendering_options.each_pair { |key, value| ... } ⇒ nil
Like #each_pair.
rendering_options.each_key { |key| ... } ⇒ nil
Yield each key name individually.
rendering_options.length ⇒ Integer
Number of options.
rendering_options.size ⇒ Integer
Same as #length.
rendering_options.add_observer(observer) ⇒ Boolean
Register a ModraUp::RenderingOptionsObserver. Adding the same object a second time returns false.
rendering_options.remove_observer(observer) ⇒ Boolean
Remove the observer.