How to set "Clip Start" for all workspaces (Layout,Modeling,Sculpting,UV Editing etc) at once?

Hello guys,

Is that possible or do i need it to set it individual for each workspace?

Thanks.

Make new (to load Startup File), change Clip Start , then File → Defaults → Save StartUp file.

But how to change Clip Start for all workspace at once?

Ups, i think i was a bit fast… well yes, this is really weird, i never came across this for multiple workspaces only sometimes while modeling and using other meshes…

Yes it seems to be that all workspaces have their own instance of settings including clipstart, if you duplicate on it inherits the changes…

Yeah, i know that. I was wondered if there is way to change it for all at once.
Anyway thank you for help :slight_smile:

i made a addon a while back that is able to do that, it will set the clip ranges based on the selected objects and there is a option in the preferences to adjust the clip factors.

I just installed it from GIT to have a look. Seems to work in 2.93.0 on linux. Okay, then there is only the problem to click that button for all viewport… looking at the code… not so easy to find the other workspaces from actual context… (learning again) i’m digging a little…

what do you mean click the button for all viewport? does it not work for all views that are open at once for you? or you want to add the ability to split it to specific viewports?

sorry i meant workspaces as @rogi said

Edit:

Ehem, i’m not sure now what you meant by views, it’s only changing the view clipping for the active workspace for instance Layout and does not change it in Modelling.

aha you want to have it changed in all workspaces views if it has a valid viewport?

@Okidoki i pushed a change that should do that, maybe you can give it a try and let me know if it works as you would expect

Yes, because this is what the original question was (as i understand it).
(Sometimes the blender vocabulary is … somekind of strange: viewport in the manual (GUI) is only refrenced to the ‘3D Viewport’)

Next comes some (random) thoughts (because of quite some time a wanna improve my knowledge):
I did myself a bit of scripting in 2.7x and i know something about Python, so i can read your code. My problem was always not only to find the proper daat structures but also the proper way to reach them…

So for example here:

for area in context.screen.areas:
            if area.type == 'VIEW_3D':
                for space in area.spaces:
                    if space.type == 'VIEW_3D':
                        space.clip_start = minClipping / pref.clip_start_factor
                        space.clip_end = maxClipping * pref.clip_end_factor

you iterate over the areas of the screen to find the space with type VIEW_3D which is the 3D View port; and this all happens in the actual workspace although it’s never referenced anywhere (something like : bpy.context.workspace)(so the screen is in the workspace? (asking myself).
But really nice would be some over BlendData.workspaces which seems to hold the workpspaces (docu says: Collection of workspaces)…

So i’m looking for a solution based on you plugin (maybe option: For all Workspaces)

context is always what is active, in this case the active workspace.
if you open the scripting workspace in blender you can use TAB to see what’s available, its quite useful to navigate the data structure

if you want to access the BlendData.workspaces you need to go to bpy.data.workspaces, you shoudl be able to find that via the console window

Yes, i know re-discovered autocomplet just lately (a few hours ago :sweat_smile:), but i totally overlooked bpy.data.workspaces, thanks :pray:, have to dig some more…

1 Like

in case you missed it, i pushed a change to the addon to apply the clipping to all workspaces. If you want to try to get it to work on your own then dont peek;D

@rogi (hopefully) this will solve your problem
@kromar you are awesome fast, addon works with 2.93.0 under linux, have to investigate code more when i had a good sleep, saw you debugging print outs for finding the right place :wink: , tired now :sleeping:

1 Like

Thank you guys, finally it helped me.

Have a nice day.

1 Like

I updated the addon to adapt dynamically to the selected objects. Use the button to turn the dynamic updating on or off.
if you run into any issues let me know. the original addon thread can be found over here: https://blenderartists.org/t/camera-clipping-assistant/