-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Rewrite: BB2 Redux #32
Comments
The plan. (might change as it progresses, and is not chronologic)
|
Great plan! |
I like a fresh start, unfortunately there won't be anything to test for a while.. it's like a fetus now |
I made a new branch and split the panels into their own source files. This is no-where near working, but it's necessary until gradually things start to work again. It is my hope that I will have useful progress before the replacement dependency graph (aprox two weeks from now according to the developers meeting). It has been difficult to find motivation to do this lately, but i'd like to think I can finish what I started. |
panels are now separated, and load in the correct sequence. now to start linking up the global storage dictionaries again. This is the part I'm not terribly sure what kind of time it will take. But already in the last 2 hours this has gone faster than I anticipated. Back to coding. |
Good to hear things are going! |
it would help me a lot if you found time to learn how to use GIT from the command-line, or find someone to teach you. Even if you aren't coding anything it helps if i'm confident that the files you are testing are indeed the branch i'm working on. There are only a few commands that anyone needs to know git pull --all
git push --all
git add --all
git commit -a -m "commit message here"
git checkout -b <branch_name> # new_branch_name_based_on_current_branch
git branch -D <branch_name>
git branch |
OK, I'll make an effort, (find someone to help me tomorrow, if available). |
This is much easier to navigate now. wow. I think the import panel has reached feature parity with older versions, but it has not been tested extensively yet. The import panel is 99% existing code, and small changes to make things Blender version agnostic. I've replaced boolean and integer global variables with scene specific properties which are by definition global. Added aliasing to avoid 'dot lookups' where possible. Time to continue to the next panel. MLP. because I know it a little bit. |
Beautiful! |
i'll look at it. The code feels a little like this now : screenshot from 2015-05-08 14 46 23 there's a conversion function that strips out the colour, will look carefully at what it does. |
WOW, it makes me feel dizzy with vertigo! |
(wrong button pressed closed the thread) here's the abstract of those two functions, ps: this might take a while to fully write and will edit this post over the course of hours/days. I have made no functional changes to any of this code, except minor formatting (may 2015). bb2_operator_mlp()In theory:
bb2_operator_mlp_render()
mlp()..todo mlpRender()..todo |
While reading the operator code, I'm wondering if it wouldn't be tidier if there was a UI list, which shows the currently imported models, and lets the user select them from there, rather than the atoms. I'll read up on how to do a UI list, it's something i've wanted to know for a while anyway. |
Several issues here:
Hope this hleps! |
on reflection yes, using the outliner alone is fine for atom selection i'm not sure about this question:
My code changes shouldn't have changed any operational features, are you asking me about the internals or has something changed due to my edits? |
mlp()Quoted text by monzop as response to my (zeffii) code observations.
|
mlpRender()todo |
@MonZop i've formatted that last post so it is more clear to me (and readers) who is commenting what. |
OK, i'll check out OBJCreator script |
the .dx file is a massive list of 3 Floats per line (I doubt these are colours?) In the end where do you want the colour to come from? |
wait... the dx file is a grid ? a representation of values in a 3d vector space? So is the idea to make the polygons on the 'SURFACE' object mesh to the nearest value in the dx file? |
object 1 class gridpositions counts 43 40 34
origin -2.213350e+01 -1.778850e+01 -1.658250e+01
delta 1.000000e+00 0.000000e+00 0.000000e+00
delta 0.000000e+00 1.000000e+00 0.000000e+00
delta 0.000000e+00 0.000000e+00 1.000000e+00
object 2 class gridconnections counts 43 40 34
object 3 class array type double rank 0 items 58480 data follows suddenly makes more sense: 43 * 40 * 34 == 58480 |
'''
Define atom scales
0 vdw = visual Van der Waals scale
1 cov = visual covalent scale
2 collision = collision radius scale
3 color = representation
'''
atom_properties = {
# : vdw, cov, collision, color
'C': [1.35, 1.10, 0.6, [0.10, 0.10, 0.10]],
'CA': [1.59, 0.99, 0.6, [0.40, 1.00, 0.14]],
'N': [1.23, 1.07, 0.6, [0.24, 0.41, 0.70]],
'O': [1.20, 1.04, 0.6, [0.46, 0.10, 0.10]],
'S': [1.43, 1.46, 0.6, [1.00, 0.75, 0.17]],
'P': [1.43, 1.51, 0.6, [1.00, 0.37, 0.05]],
'FE': [1.59, 0.64, 0.6, [1.00, 0.50, 0.00]],
'MG': [1.37, 0.65, 0.6, [0.64, 1.00, 0.05]],
'ZN': [1.10, 0.74, 0.6, [0.32, 0.42, 1.00]],
'CU': [1.10, 0.72, 0.6, [1.00, 0.67, 0.00]],
'NA': [1.80, 0.95, 0.6, [0.80, 0.48, 1.00]],
'K': [2.18, 1.33, 0.6, [0.72, 0.29, 1.00]],
'CL': [1.37, 1.81, 0.6, [0.10, 1.00, 0.60]],
'MN': [1.59, 0.46, 0.6, [0.67, 0.60, 1.00]],
'H': [0.95, 0.53, 0.3, [0.90, 0.90, 0.90]],
'F': [1.16, 1.36, 0.6, [0.27, 0.80, 0.21]]
} |
the above table is not updated from data in your table (yet!), merely the three old tables merged. |
atom_properties = {
# : vdw, cov, collision, color
'C': [1.70, 0.70, 0.6, [0.10, 0.10, 0.10]],
'CA': [2.30, 1.80, 0.6, [0.40, 1.00, 0.14]],
'N': [1.55, 0.65, 0.6, [0.24, 0.41, 0.70]],
'O': [1.52, 0.60, 0.6, [0.46, 0.10, 0.10]],
'S': [1.80, 1.00, 0.6, [1.00, 0.75, 0.17]],
'P': [1.80, 1.00, 0.6, [1.00, 0.37, 0.05]],
'FE': [1.30, 1.30, 0.6, [1.00, 0.50, 0.00]],
'MG': [1.73, 1.30, 0.6, [0.64, 1.00, 0.05]],
'ZN': [1.40, 1.30, 0.6, [0.32, 0.42, 1.00]],
'CU': [1.40, 1.40, 0.6, [1.00, 0.67, 0.00]],
'NA': [2.27, 1.60, 0.6, [0.80, 0.48, 1.00]],
'K': [2.75, 2.00, 0.6, [0.72, 0.29, 1.00]],
'CL': [1.75, 1.00, 0.6, [0.10, 1.00, 0.60]],
'MN': [1.40, 1.40, 0.6, [0.67, 0.60, 1.00]],
'H': [1.20, 0.30, 0.3, [0.90, 0.90, 0.90]],
'F': [1.47, 0.60, 0.6, [0.27, 0.80, 0.21]]
} This table includes the more realistic sizes for VdW and Cov. I will work more on colors |
Cool. now the table exists, could implement it a.s.a.p. and make a new branch for the modified table, it doesn't have a massive impact on the code. maybe I'll delete / "stash"(archive) stages s1..s5, or delete them altogether. |
i've pushed, but not yet tested. I like the leading lines, normally we don't format 'dicts' in any special way, but because this is a table with a legenda, I think this convention is OK. atom_properties = {
# vdw
# | cov
# | | collision
# | | | color
# | | | |
'C': [1.70, 0.70, 0.6, [0.10, 0.10, 0.10]],
'CA': [2.30, 1.80, 0.6, [0.40, 1.00, 0.14]],
'N': [1.55, 0.65, 0.6, [0.24, 0.41, 0.70]],
'O': [1.52, 0.60, 0.6, [0.46, 0.10, 0.10]],
'S': [1.80, 1.00, 0.6, [1.00, 0.75, 0.17]],
'P': [1.80, 1.00, 0.6, [1.00, 0.37, 0.05]],
'FE': [1.30, 1.30, 0.6, [1.00, 0.50, 0.00]],
'MG': [1.73, 1.30, 0.6, [0.64, 1.00, 0.05]],
'ZN': [1.40, 1.30, 0.6, [0.32, 0.42, 1.00]],
'CU': [1.40, 1.40, 0.6, [1.00, 0.67, 0.00]],
'NA': [2.27, 1.60, 0.6, [0.80, 0.48, 1.00]],
'K': [2.75, 2.00, 0.6, [0.72, 0.29, 1.00]],
'CL': [1.75, 1.00, 0.6, [0.10, 1.00, 0.60]],
'MN': [1.40, 1.40, 0.6, [0.67, 0.60, 1.00]],
'H': [1.20, 0.30, 0.3, [0.90, 0.90, 0.90]],
'F': [1.47, 0.60, 0.6, [0.27, 0.80, 0.21]]
} |
I guess, as a layman, the lower image makes more sense if I imagine tubes connecting the atoms to represent bonds.. |
Oh oh, something wrong. |
But the VdW look right |
weird :) i don't see anything immediately wrong with how I restructured the code, but it does seems weird that the game radius is larger than the covalent radius 0_o |
OK, i don't know :) |
The code should behave the same as before, but the big difference are the new values of the Covalent. I could for a test replace the cov scales values with the original ones, to see if I made a mistake in the scale assignments (it's not much effort to find out) |
btw, 'covalent scale' , what measurement is that relative to ? the radius of a H atom? |
I notice that in the Transform panel, (besides the fact that all parameters are keyframed, including Scale, which should not be), there is the Dimension value, and a Scale value.. |
hmm, it may be that the cov values in the old table take this into account? It may just require a simple inversion.. |
hehe, I raised this concern even before tackling the code: #32 (comment) |
Good point! |
I would say that it is the typical Carbon atom, radius 0.7 |
right, everything is scaled relative to the carbon atom then |
maybe figure this out today, I have some quiet time to myself. |
Oooops!! Checking the new Bledner, I was playing with MLP, and noticed that it does map perfectly on the surface, but the render has lost the texture and material features. |
Which branch? I don't recall modifying a lot of code for the MLP panel, it is entirely possible that I didn't catch one or two things. I have the feeling that render / baking still relies on the values in one of the imported temporary files..and may just need to be told to read the new vertex colour data for baking noise. Also i'm still not sure what exactly to do about the vdw / covalent scale flip, but the code to do it is in place |
I responded , but can't look at the code right now |
OK, I can return to this now, this bugs the hell out of me. I'll write a small test script that generates an Atom of each type and provide a switch to flip between covalent vs vdw radius. This way the table and switching radii can be understood separately from the BioBlender addon. It doesn't make the slightest bit of difference if we are looking at Molecules or just a string of unique atoms in x,y space to get the right scaling. I'd really like to move on from this bit of the code. |
or an artificial soup of molecules that show each type of atom, for quick debugging |
I have prepared a pdb file, called BunchOfAtoms, but 1. I do not remember how to add it to the Test Molecules folder and 2. I am a little ashamed at circulating a totally meaningless/impossible atomic file. |
yes, please send via email. it's a debug pdb then..so not entirely meaningless :) |
Over the next couple of days (unless something unforeseen happens) I have time to make a start with building the add-on from scratch. Getting it to match the working features of BB2 will take a while. It's difficult to put a time frame on it until the process gets rolling.
The decision to start from scratch is not done in haste. I think some of the responders on this repository have expressed similar feelings about how to proceed. There's lots that can be taken from the current code-base, but a lot that I really want to sanitize and arrange into separate files. The core of this was written when Blender 2.5 was still young and the API not very well defined, and prone to convoluted solutions.
If I can reach feature parity and structure the code better then I will consider it a success, speeding up the import (and avoiding recursive updates) is not my first priority, making it easier for others to contribute is far more important.
Ticks indicates functionality seems to be restored for that panel, certainly report any issues with those sectons. The unticked sections have had no major checks done other than suppressing import errors. The section labelled
next
is either being worked on or that's where the most recent code changes have taken place.<---next
The text was updated successfully, but these errors were encountered: