How to hide page

how to hide page ,and hide the tab above?

You cannot hide an individual scene page from the user.

There is no persistent API method exposed to show or hide the scene tabs. (This is considered a user feature.) But there are send actions that can work on the View menu item …

def toggle_scene_tabs
  if Sketchup.platform == :platform_win
  else # Mac

WARNING: (Note that send action IDs are officially “unsupported” and are not guaranteed to work in current or future versions of the API. It is expected that some time in the future that the send_action method would be deprecated in favor of better API features.)

However in recent versions, the model saves the state of whether the scene tabs are shown or hidden. So when reopening a model, the state of the tabs should be restored.

Can I ask why you want to hide the Scenes tab? I see you what looks like an Advanced Camera Tools camera, is that related to this question?

As far as i know, the only way to “hide” a scene, is to disable “Include this scene in slideshows” in the scene settings:

This wil place the scene name in the tab between brackets, but wil stil show the tab for future use if needed.

The scene wil not show in the exported animation or exported images.

because I have a operation that will delete all pages of camera component.
And after some works, I need to create pages by these camera component again
but I can’t get params info such as “eye,target,up” to create pages and set page::camera info .
so I think it is another way to hide page before some woks over, so that I can show page again without create again.
but I find out the only good way is just to get the camera info from these camera component…

and for example,I can’t create page and set its camera info ,because I can’t find the eye point from a camera component created by ACT plugin

The Page #camera method retrieves the camera for a particular page.
The Camera #eye method is used to retrieve the eye Point3d object for the Camera.


model = Sketchup.active_model
pages = model.pages
eyepoint1 = pages["Camera 1 (ACT)"].camera.eye
eyepoint2 = pages["Camera 2 (ACT)"].camera.eye
1 Like

I know these api, what I wanna know is how to get these info from camera cpmponent directly, for example ,there is no page for a camera component copied ,just like the picture below

Copying is not how the ACT extension works. The extension must create the cameras (and their corresponding scene pages.) Otherwise is not a ACT camera.

yes ,so I’m researching how to create the corresponding scene through the copied camera component :joy:
and now an idea is to study the relationship between the geometric information of the camera component of ACT and the eye, target, up of the camera

As far as I see the ACT create a group and transform it to the eyepoint and its x axis direction will be the camera direction. So you need to retrieve the transformation of this group. If you are copying and orienting it (and/or creating a new component instance) then you can retrieve the transformation of this new instance…then examine this transformation.

The Group #transformation method is used to retrieve the transformation for the group.
The ComponentInstance #transformation method is used to retrieve the transformation of this instance.

The Transformation #origin method retrieves the origin of a rigid transformation.
The Transformation #xaxis method retrieves the x axis of a rigid transformation.

e.g.: let’s assume that you selected the camera (and only that) in question:

model = Sketchup.active_model
sel = model.selection
mycamera = sel.first
t = mycamera.transformation
eyepoint = t.origin
direction = t.xaxis

(BTW. The original camera object - created by ACT - have an attribute dictionary named “camera” attached to the instance. This dictionary contains additional information - such as aspect ratio, fov, perspective … ect.)

1 Like

thanks ,I just tested it out that I can get camera information through transformation. In addition, the zaxis is the up of the corresponding camera, right?

Seems to be…