Context updater

8 posts / 0 new
Last post
Wolfsbane's picture
Offline
Joined: 12/27/2017 - 10:45
Context updater

Hello again, ive tried for the past few days to make a system like in the userprefs whit enum buttons that redraw the area, so far ive been successful in making it but im stuck, i make it for the properties panel which i modified but i cant use mainb, mainbo nor mainbuser and preview updates everything, so ive tried to write my own bitflag but i cant seem to be able and the error messages dont say anything helpful. Does someone over here has a clue how to make a independent flag for lets say redraw the data tab only but isnt influenced if the user clicks on other tabs (with preview and mainb it has the funny but annoying custom to switch according to what was opened last, Render = 1. enum, Renderlayers 2. enum, etc even if its in the data tab) ? 

i really dont know where else i could ask, blender irc chats (i tried most of them) are ignorant, blender stackexchange is python only and blenderartists are trolls. neither do i find any educational manuals, the best one ive seen is also from BforArtists so thank you very much if anyone can help me, this is the only place i know where i can ask without getting angry comments...

up
0 users likes this.
Reiner's picture
administrator, developer
Offline
Joined: 07/25/2015 - 08:59
Hi Wolfsbane,

Hi Wolfsbane,

This would only work with a C prop. The usual Python methods are global. There is simply no way to make a Python flag local. Sorry that i have no better news here.

up
0 users likes this.

Free gamegraphics, Freeware Games http://www.reinerstilesets.de

Wolfsbane's picture
Offline
Joined: 12/27/2017 - 10:45
i know, thats why i asked. i

i know, thats why i asked. i did a C prop and it works but not with mainb, i would have to make a new bitflag in the source file but when i try to make one then i get plenty errors but no error to pinpoint the problem. So my question would be how to make a bitflag that can redraw the area only locally in data only without affecting the other mainb tabs. So basically i need to know how to add a new SDNA

when i add to in the DNA_space_types to the location where for example mainb, mainbo, mainbuser and stuff like preview is a new flag then all i get are hundred errors but no help. but for example in dna_userdef_types there is a flag called userpref which i cant find in the editor files nor anywhere else and it still works

till now i just fixed that problem with using "flag" as sdna but i dont know if that would cause any trouble, if not then i wont mind but im not sure.

up
0 users likes this.
Reiner's picture
administrator, developer
Offline
Joined: 07/25/2015 - 08:59
I see. I am of no big help

I see. I am of no big help with that, unfortunately. I am also in big trouble when i need to do this. I avoid to touch the C part where ever possible. It's a inhomogenous mostly uncommented mess. The same thing gets done in a dozen different ways. And you can never be sure if you don't run into a conflict here.

The few C code flags that i have implemented were added to places that already exists. You could grep an existing flag, and follow how it is implemented. Then try to repeat the method. In the end everything working is allowed Smile

up
1 user likes this.

Free gamegraphics, Freeware Games http://www.reinerstilesets.de

Wolfsbane's picture
Offline
Joined: 12/27/2017 - 10:45
Youre more of a help than you

Youre more of a help than you think, youre also the first who doesnt sugarcoat the uncommented mess which they call themselves chaos at some points on the Blender Wiki. Glad that its not just me who has sometimes trouble with it Smile im looking forward for Blender 2.8, i hope they really do cleanup their Code as they promised!

up
0 users likes this.
Wolfsbane's picture
Offline
Joined: 12/27/2017 - 10:45
by the way, could you provide

by the way, could you provide some of these sdna flags i could track down which could help the most? 

up
0 users likes this.
Reiner's picture
administrator, developer
Offline
Joined: 07/25/2015 - 08:59
I'm sorry, i cannot. It all

I'm sorry, i cannot. It all depends of the editor where you want to use it in. Some stuff just works in the Properties editor, some stuff just works in the User Preferences ...

up
0 users likes this.

Free gamegraphics, Freeware Games http://www.reinerstilesets.de

Reiner's picture
administrator, developer
Offline
Joined: 07/25/2015 - 08:59
As a little example, here's

As a little example, here's the original patch from Julian Eisel to hide the 3D cursor, which gots declined in those days https://developer.blender.org/D1110

This functionality now made it after many years into newest Blender version. It's now in the User Preferences. And is different implemented. You could grep this one to its roots.

Attach Image: 
up
1 user likes this.

Free gamegraphics, Freeware Games http://www.reinerstilesets.de

Log in or register to post comments