Class: ModraUp::Page
- Inherits:
-
ModraUp::Entity
- Object
- ModraUp::Entity
- ModraUp::Page
Overview
A page scene (the scene tab in the interface). The camera and hidden layers are saved by the core; axes, styles, shadows, and section planes have no associated data.
Instance Method Summary # collapse
-
#name ⇒ String
Name on the scene tab.
-
#name=(name) ⇒ String
Renames the page. If the name is already taken, the host generates a unique name.
-
#description ⇒ String
Documentation in the Scene Manager.
-
#description=(text) ⇒ String
Set the description.
-
#camera ⇒ ModraUp::Camera
The camera on this page. Changing it will write back to the scene; if this page is the currently selected one, the viewport will update accordingly.
-
#shadow_info ⇒ ModraUp::ShadowInfo
Returns the ModraUp::ShadowInfo settings saved with this scene, independently of the model's current shadow settings. The scene's use_shadow_info? flag controls whether switching to the scene applies them.
-
#delay_time ⇒ Float
Slide duration in seconds. New scenes use -1 to inherit the model default from model.options["SlideshowOptions"]["SlideTime"].
-
#delay_time=(seconds) ⇒ Numeric
Set the number of seconds to pause.
-
#transition_time ⇒ Float
The number of seconds for the transition to this page. A new scene of -1 indicates using the model's default transition time (model.options["PageOptions"]["TransitionTime"]).
-
#transition_time=(seconds) ⇒ Numeric
Set the transition time in seconds.
-
#include_in_animation? ⇒ Boolean
Does this page appear during the animation playback («View › Animation › Play»).
-
#include_in_animation=(include) ⇒ Boolean
Set whether to include in animation.
-
#layers ⇒ Array<ModraUp::Layer>, nil
The layers on this page that are hidden. If layer visibility is not used, it defaults to nil.
-
#layer_folders ⇒ Array<ModraUp::LayerFolder>, nil
The hidden layer folders on this page. Returns nil if layer visibility is not in use.
-
#set_visibility(layer, visible) ⇒ ModraUp::Page
Sets whether layers or layer folders are visible on this page. Only changes the scene's saved content and does not affect the current viewport.
-
#get_drawingelement_visibility(element) ⇒ Boolean
The element is visible on this page (for hidden geometry/scenes saved). Uncontrolled elements (ordinary geometry in groups or components) return true.
-
#set_drawingelement_visibility(element, visible) ⇒ Boolean
Sets the visibility of elements on this page, only modifying the scene's saved content. Controlled are the drawing elements at the model root («top-level hidden geometry») as well as groups and components at any level («hidden objects»); other elements return false.
-
#hidden_entities ⇒ Array<ModraUp::Drawingelement>, nil
The hidden drawing elements on this page. Only lists ordinary geometry when hiding geometries, and only lists groups and components when hiding objects; returns nil if neither is hidden.
-
#rendering_options ⇒ ModraUp::RenderingOptions
The rendering style saved for this page. Reading and writing is a scene snapshot, not modifying the current view; it becomes effective when switching to this scene and applying the style. Unsaved scenes read the current model values, and the first write saves the current model style as the base.
-
#update ⇒ Boolean
Updates the page in the current viewport. Omitting the flag uses PAGE_USE_ALL. The camera is set to the current ModraUp::View#camera; layer visibility copies the current hidden layers.
-
#model ⇒ ModraUp::Model
The model it belongs to.
-
#parent ⇒ ModraUp::Pages
Parent scene table.
-
#deleted? ⇒ Boolean
Returns true after being deleted from the scene table.
-
#valid? ⇒ Boolean
If the page is valid, it returns true.
-
#typename ⇒ String
Fix Page.
-
#use_camera? ⇒ Boolean
Returns whether the camera is saved.
-
#use_camera=(setting) ⇒ Boolean
Returns whether the camera is saved.
-
#use_rendering_options? ⇒ Boolean
Whether to save the drawing style. The scene page does not save ModraUp::RenderingOptions separately; switching scenes does not change the style.
-
#use_rendering_options=(setting) ⇒ Boolean
Whether to save the drawing style flag.
-
#use_shadow_info? ⇒ Boolean
Does whether to apply the page's shadow parameters when switching scenes.
-
#use_shadow_info=(setting) ⇒ Boolean
Controls the saving and application of shadow parameters for this page; update re-captures the current parameters.
-
#use_axes? ⇒ Boolean
Whether to save the axes. This kernel has no Axes data.
-
#use_axes=(setting) ⇒ Boolean
Whether to save axis flags.
-
#use_hidden? ⇒ Boolean
Returns whether hidden geometry is saved (for the merged flag prior to 2019).
-
#use_hidden=(setting) ⇒ Boolean
Whether to save hidden geometry flags.
-
#use_hidden_layers? ⇒ Boolean
Whether to save layer visibility.
-
#use_hidden_layers=(setting) ⇒ Boolean
Whether to save layer visibility.
-
#use_section_planes? ⇒ Boolean
Whether to save the section planes. This core does not have section plane data.
-
#use_section_planes=(setting) ⇒ Boolean
Whether to save section flagsticks.
-
#use_hidden_geometry? ⇒ Boolean
Whether to save hidden geometry (SketchUp 2020+).
-
#use_hidden_geometry=(setting) ⇒ Boolean
Whether to save hidden geometry flags.
-
#use_hidden_objects? ⇒ Boolean
Whether to save hidden groups/components.
-
#use_hidden_objects=(setting) ⇒ Boolean
Whether to save the hidden group/component flag.
-
#use_environment? ⇒ Boolean
Whether to save ambient light. This core does not have Environment data.
-
#use_environment=(setting) ⇒ Boolean
Whether to save the environment flag.
-
#use_style? ⇒ Boolean
Returns whether styles are saved. This core page does not have a style, fixed to false.
-
#use_style=(style) ⇒ Object
SketchUp assigns the style object to the scene. This core operation is ignored and returns the parameter itself.
Inherited from ModraUp::Entity
-
#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.
-
#add_observer(observer) ⇒ Boolean
Register a ModraUp::EntityObserver. Adding the same object a second time returns false. Locking, property, and material changes will dispatch an onChangeEntity event.
-
#remove_observer(observer) ⇒ Boolean
Remove the entity observer.
-
#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.
-
#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.
-
#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
page.name ⇒ String
Name on the scene tab.
page.name=(name) ⇒ name
Renames the page. If the name is already taken, the host generates a unique name.
page.description ⇒ String
Documentation in the Scene Manager.
page.description=(text) ⇒ text
Set the description.
page.camera ⇒ ModraUp::Camera
The camera on this page. Changing it will write back to the scene; if this page is the currently selected one, the viewport will update accordingly.
#shadow_info ⇒ ModraUp::ShadowInfo
Returns the ModraUp::ShadowInfo settings saved with this scene, independently of the model's current shadow settings. The scene's use_shadow_info? flag controls whether switching to the scene applies them.
page.delay_time ⇒ Float
Slide duration in seconds. New scenes use -1 to inherit the model default from model.options["SlideshowOptions"]["SlideTime"].
page.delay_time=(seconds) ⇒ seconds
Set the number of seconds to pause.
page.transition_time ⇒ Float
The number of seconds for the transition to this page. A new scene of -1 indicates using the model's default transition time (model.options["PageOptions"]["TransitionTime"]).
page.transition_time=(seconds) ⇒ seconds
Set the transition time in seconds.
page.include_in_animation? ⇒ Boolean
Does this page appear during the animation playback («View › Animation › Play»).
page.include_in_animation=(include) ⇒ include
Set whether to include in animation.
page.layers ⇒ Array<ModraUp::Layer>, nil
The layers on this page that are hidden. If layer visibility is not used, it defaults to nil.
page.layer_folders ⇒ Array<ModraUp::LayerFolder>, nil
The hidden layer folders on this page. Returns nil if layer visibility is not in use.
page.set_visibility(layer, visible) ⇒ pagepage.set_visibility(layer_folder, visible) ⇒ page
Sets whether layers or layer folders are visible on this page. Only changes the scene's saved content and does not affect the current viewport.
page.get_drawingelement_visibility(element) ⇒ Boolean
The element is visible on this page (for hidden geometry/scenes saved). Uncontrolled elements (ordinary geometry in groups or components) return true.
page.set_drawingelement_visibility(element, visible) ⇒ Boolean
Sets the visibility of elements on this page, only modifying the scene's saved content. Controlled are the drawing elements at the model root («top-level hidden geometry») as well as groups and components at any level («hidden objects»); other elements return false.
page.rendering_options ⇒ ModraUp::RenderingOptions
The rendering style saved for this page. Reading and writing is a scene snapshot, not modifying the current view; it becomes effective when switching to this scene and applying the style. Unsaved scenes read the current model values, and the first write saves the current model style as the base.
page.update ⇒ Booleanpage.update(flags) ⇒ Boolean
Updates the page in the current viewport. Omitting the flag uses PAGE_USE_ALL. The camera is set to the current ModraUp::View#camera; layer visibility copies the current hidden layers.
page.model ⇒ ModraUp::Model
The model it belongs to.
page.parent ⇒ ModraUp::Pages
Parent scene table.
page.deleted? ⇒ Boolean
Returns true after being deleted from the scene table.
page.valid? ⇒ Boolean
If the page is valid, it returns true.
page.typename ⇒ String
Fix Page.
page.use_camera? ⇒ Boolean
Returns whether the camera is saved.
page.use_camera=(setting) ⇒ setting
Returns whether the camera is saved.
page.use_rendering_options? ⇒ Boolean
Whether to save the drawing style. The scene page does not save ModraUp::RenderingOptions separately; switching scenes does not change the style.
page.use_rendering_options=(setting) ⇒ setting
Whether to save the drawing style flag.
page.use_shadow_info? ⇒ Boolean
Does whether to apply the page's shadow parameters when switching scenes.
page.use_shadow_info=(setting) ⇒ setting
Controls the saving and application of shadow parameters for this page; update re-captures the current parameters.
page.use_axes? ⇒ Boolean
Whether to save the axes. This kernel has no Axes data.
page.use_axes=(setting) ⇒ setting
Whether to save axis flags.
page.use_section_planes? ⇒ Boolean
Whether to save the section planes. This core does not have section plane data.
page.use_section_planes=(setting) ⇒ setting
Whether to save section flagsticks.
page.use_environment? ⇒ Boolean
Whether to save ambient light. This core does not have Environment data.
page.use_environment=(setting) ⇒ setting
Whether to save the environment flag.
page.use_style? ⇒ Boolean
Returns whether styles are saved. This core page does not have a style, fixed to false.
page.use_style=(style) ⇒ style
SketchUp assigns the style object to the scene. This core operation is ignored and returns the parameter itself.