Hiding objects in unity without changing their state - unity3d-editor

I have a vague memory of a Unity video tutorial where the guy hid some objets while building a scene. The thing is that he dind't use the usual 'disable/enable the object via the inspector checkbox' and so he didn't have to worry to enable them later... moreover, as the objects were 'invisible but enabled', all attached behaviours were working.
As far as I remember the effect was pretty similar to moving the object into a hidden layer (but not changing the object layer but using a different Unity built-in action so he actually dind't change anything in the object).
I've been trying to remember how he did such a thing and looking around the editor to find the specific option but with no luck. Honestly, I'm beginnig to think that I might not be remembering correctly. Do anyone know about this 'hide objects without changing them' command?
Regards!

Sounds like he might have just turned the object's renderer off. Each GaneObject is going to have some kind of renderer as a property in the inspector (sprite renderer if its 2D, ect). He probably just disabled that as opposed to disabling the entire GameObject. Let me know if that helps!

I've just received by chance a link to a video on twitter (I think it's the very same I was trying to remember but I'm not 100% sure). Anyway it seems that my current Unity version 2018.3.3) doesn't include that 'Scene visibility' toggle; it seems to be available for 2019 Beta. . I didn't test it yet but it seems pretty straightforward, just click on a gray bar in the hierarchy bar, to the left of the object you want to 'hide'; the bar seems to work as a an visible/not visible toggle. Here a link to de video where you can see the thing working!
I hope it helps!!

Related

Problems with the IFCJS floorplan system

i need some help, i have this error using a floorplans, but I believe this error comes from something I did wrong in the visibility part, can help me?
the image before selecting the plan appears on the background as edges
I assume that you are using web-ifc-viewer. Just to give some more insight on this, the postproduction of web-ifc-viewer is an additional HTML elements that is displayed on top of the Three.js canvas.
For performance reasons, this layer only gets updated when the user stops moving the camera. When you go into floorplan mode, you need to disable the postproduction manually. This can be done like this:
ifcViewer.context.postProduction.active = false;
This also means that when you go back to 3D mode, you probably need to activate it again. FYI, you can also update the postproduction on demand:
ifcViewer.context.postProduction.update();
I found the error, I'll leave my solution here in case you need to help someone.
You need to activate the togglePostproduction function. like so:
togglePostproduction();

How to unfullscreen a window without notifying it?

I'm trying to enhance the gTile extension by allowing it to resize a fullscreen window to a tiled area of the screen. That's a pretty common thing to do when tiling and it's pretty handy since some windows will hide some chrome when in fullscreen mode. But I'm having the hardest time figuring out how to do that.
Searching the internet led me to this forum post which mentions EWMH and _NET_WM_FULLSCREEN. I've tried to find ways to access window manager hints but can't find anything bashing by head on Looking Glass or scanning through the docs. Is this kind of thing possible through a shell extension?
Meta.Window is likely what you are looking for:
https://gjs-docs.gnome.org/meta4~4_api/
Setting Window.decorated = false may be able to remove the title bar or perhaps getting the compositor object and changing it from there. However this will still keep the address and tab bars in chrome. You may need to find another method to signal chrome to hide those.
There is not really an easy way to do this, the thread you linked is in regards to VLC and modifying it's source code.

Adobe Extendscript Photoshop Guides Visibility

Is there a way via extendscript (jsx) to get the visibility status of Photoshop' guides?
The code to show and hide the guides is the same code as it 'toggles' the guides on or off so it must know the status when this code is executed, but how do I get at it?
I appreciate this could be done via a preference switch but that seems an awkward hack for something this simple, especially as something somewhere must be accessing this 'property' during execution of the 'toggle' code.
What would be great is to have activeDocument.guides.visible property, returning either true or false. Is there anything like that?
EDIT:
OK. Further investigation reveals that creating a guide using guides.add does not automatically toggle guides ON, however, using the code generated via the scriptListener does.
I would rather use guides.add as its only one line of code compared to fourteen so in order to toggle the guides to ON I thought I could run a function that created and then deleted a guide using the scriptListener code during the onLoad of the HTML.
This works great, except getting this function to run only when a document is opened is now the new problem.
documentAfterActivate is supposed to be the code to do this except it doesn't work unless a flash panel such as kuler is opened first.
So the question now is really what part of the flash code is allowing documentAfterActivate to work properly and how can I use it in my code instead of opening a flash panel I don't need?
It doesn't look like you've got a direct toggle option. You'd need to record the position of the guides somewhere and use script listener code to clear them when you wanted to toggle them off and use the add method on the Guides object to re-add them.
Keep in mind that even getting to the guide position via the photoshop DOM wasn't avail before CS4 I think? maybe CS5.
And i realised I just mis-read your question quite a bit. Anyway, this way you'd also know if the guides were visible based on whether or not they are there :) But yes, it isn't as nice as it could be.
The solution:
As stated, the workaround is to create and delete a guide with the fourteen lines of code from the scriptListener.
This toggles the guide visibility to ON regardless of its current state.
I can then save this status as a preference using putCustomOptions.
A function to do this is fired during the onLoad of the HTML but only when a document is opened otherwise guide creation fails.
documentAfterActivate does not work as expected unless a further flash panel (such as Kuler) is also opened beforehand.
An alternative to documentAfterActivate is to register the open event using CSevent instead.
The code can be found HERE.

Using QT For Creating a Screen Dimmer

I'm trying to implement a screen dimmer using QT4 and I wanted some advice before I get cracking instead of going into this blindly.
I want to create a top-level window that has no frame. I was thinking of making the background black and messing with the opacity so that it will dim the screen out after the system is idle for a given period of time.
The problem with this is that if this window is always on top, how can I pass click events to the window underneath it? I'm not the least bit familiar with the windows API (the solution only has to work under windows), but I'm guessing that's a good place to start. Can anyone point me to some useful classes/functions or suggest another way of doing this via QT?
If anyone's interested in the solution I came up with and the windows API functions I used, you can check out my blog posting here: http://sarcastichacker.com/getnextwindowandgetforegroundwindow
I will be updating the source and making another related posting on the same blog within the next couple of days.

Disable print, print screen, right click using asp.net

How to Disable print, print screen, right click using asp.net
You cant. You cannot avoid content being copied from your pages.
Disabling Right Click is possible, but it doesnt solve your 'problem'. The user could still copy your image, by disabling javascript or just inspecting the source.
And even if you could disable those keys, the user could still just make a photo of his monitor. Good luck disabling that!
Short answer: You don't. You are writing a web application; features of the underlying platform are outside your scope, and you have no business trying to fiddle with them.
Long answer: You can try to capture those keys using javascript, and override the default behaviour, which will somewhat stop very naïve users, but all it takes to disable this "security" is to turn off javascript. Even if you come up with more sophisticated "protection", the essence remains: You are sending content to the client, and once it gets there, it is out of your hands. Given suitable tools (wget is enough for most things), anyone can copy and modify your content in any way they like. Similarly, whatever can be shown on the screen inside a browser can be captured and saved. There is no way around it. If you don't want your content copied, don't send it.
Forget about it. You will irritate your end users who will find a way to con you and do what you didn't want them to do. Forbidden fruit is always the sweetest. By telling them explicitly "you cannot do this", they will wonder why do you want to guard your content and they might try even harder to do stuff you otherwise wouldn't want them to do.
Psychology and technology are against you in this case.
Printing
You could disable printing (well sort of - it's not 100% effective) using a "print" style sheet.
I have not tried it myself, but here is a link that could get you started: http://webdesign.about.com/od/advancedcss/qt/block_print.htm
Print screen
Print screen is something that is typically controlled by the operating system not the browser nor webpage. So you are unlikely to be able to stop this. However, casting my mind back I remember a time (perhaps a long long time ago), where you couldn't take screen shots in Windows (maybe Windows 98) of videos... so if your really in need of disabling print screen - perhaps you could perhaps encode your content in a video... but this will have many many downfalls - namely accessibility, search engine optimisation and it being a royal pain to do... so I wouldn't recommend it under any circumstance.
Right screen
Right click you can disable, but not using a server-side technology (such as ASP.net) instead in a client-side technology such as javascript. A quick search in your favourite search engine will find some help. But disabling right click is rudimentary to get around, so it is not full proof.
An alternative to protect your content is to possibly investigate "rights" in PDFs. I believe you can disable the "right" to print.
However none of these solutions are going to be full-proof. As long as you are making your content available to an end-user on their own computer, there is always going to be a way around your restrictions.
I have implemented for disabling printing using window.onbeforeprint()
Refer this Answer

Resources