Is Viewport in Editor?
There is a '#if WITH_EDITOR' in C++. Not entirely sure about the blueprints but you may want to look into that variable for a blueprint equivalent.
answered Sep 11 '14 at 09:16 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here