NP Station

add-ons
architecture

(Okavango) #41

Sure, i’d be happy to help if i can.


(nBurn) #42

Thanks! I figured out a lot of the stuff I was confused about on my own, but these were the parts of “NP_020_point_move.py” I was still unsure of.

What was the reason for making “NPPMGetMouseloc” modal instead of putting all the modal stuff in the invoke function? It looks like the modal part of the code is only called once before exiting. I’m trying to figure out if I’m overlooking something because both version in this code snippet seem to work.

I also was curious why it had “NPPMGetMouseloc” and “NPPMAddHelper” as separate classes instead of one single class. Was there plans to eventually “modualize” these classes at some point or was there another reason?

Last, why are you using “copy.deepcopy()” for the mathutils objects instead of their built-in “.copy()” method? Did you find a performance benefit, was it just familiarity with “deepcopy()”, or something else? Example below:

# instead of something like this
foo = Vector((1.0, 2.0, 3.0))
bar = foo.copy()

# the addon does this
foo = Vector((1.0, 2.0, 3.0))
bar = copy.deepcopy(foo)

On another note… I made a dumb math error in my “AreFloatsEq()” function that I linked to in a previous reply (didn’t consider negative numbers as possible values for the second argument). If you plan to use it, this is the quick fix I came up with. The quick fix is still prone to failure if you have more than 3 significant digits to the left of the decimal, but it’s not a problem for how I’m using it in the newer version of my addon. If you need more than 3 “sig digs”, you’ll can try lowering the tolerance (tol value): eg 0.001 will give you 4 sig digs, 0.01 will give you 5, and so on.

***Edit: Backup links to code snippets in case hastebin.com 404’s again:


(Okavango) #43

What was the reason for making “NPPMGetMouseloc” modal instead of putting all the modal stuff in the invoke function? It looks like the modal part of the code is only called once before exiting. I’m trying to figure out if I’m overlooking something because both version in this code snippet seem to work.

You are on track, i had the problem to introduce the ‘event’ to a such simple class, i did not know how to that without the modal part. I didn’t know i could do all that just inside the ‘invoke’ part, it just produced the effect that i needed so i moved on :slight_smile: If your enhancement works, excellent, the simpler code the better. There are probably a lot of places in the code that could use further optimisation.

I also was curious why it had “NPPMGetMouseloc” and “NPPMAddHelper” as separate classes instead of one single class. Was there plans to eventually “modualize” these classes at some point or was there another reason?

Exactly, i had the plan to make most of the functions modular so i can combine them later and reuse them for various tasks. However, there are some functions that always appeared in pair so i guess they could be merged, i am open to suggestions. Also, due to macro nature of the operators, most of the functions were made as operating classes so that they can be combined through macro protocols at the end of the files.

Last, why are you using “copy.deepcopy()” for the mathutils objects instead of their built-in “.copy()” method? Did you find a performance benefit, was it just familiarity with “deepcopy()”, or something else? Example below:

 Code:
 # instead of something like this

foo = Vector((1.0, 2.0, 3.0))
bar = foo.copy()

the addon does this

foo = Vector((1.0, 2.0, 3.0))
bar = copy.deepcopy(foo)

copy.deepcopy() was the only function strong enough to definitely protect the values from changing during operation. Non-planned changing of the variables gave me a lot of problems during development. After i saw that it protected the values, i simply did not investigate further, i just moved on, there was a lot of work to be done. If there is a simpler way to achieve those protections, i will definitely use the simpler code according to your suggestions.

On another note… I made a dumb math error in my “AreFloatsEq()” function that I linked to in a previous reply (didn’t consider negative numbers as possible values for the second argument). If you plan to use it, this is the quick fix I came up with. The quick fix is still prone to failure if you have more than 3 significant digits to the left of the decimal, but it’s not a problem for how I’m using it in the newer version of my addon. If you need more than 3 “sig digs”, you’ll can try lowering the tolerance (tol value): eg 0.001 will give you 4 sig digs, 0.01 will give you 5, and so on.

No problem, i didn’t have the time yet to dig deeper into math of the addon, so if you think this is a more resilient version of the snippet, i will use that one when experimenting in the future. Thanks for the suggestion, let me know if you notice anything else.


(nBurn) #44

Thanks, I wasn’t sure if it would work at first. One of my methods for figuring code out is to remove things and see what breaks. In this case the removed part was the modal section and nothing changed.

I haven’t done any performance related testing, but the built in copy method should be similar in functionality to deepcopy. This is a script I made when testing it out.
https://pastebin.com/XSPdjufN

Actually it seems I am wrong again, but in a good way :D. I assumed my modified float compare function would go haywire with values over 900, so I tested it with mesh coordinates to find out. To my surprise it was running fine even when approaching the limits of Blender’s coordinate system (I was passing it float values over 9000). There still may be some edge cases where it fails, but have yet to find one.


(vvoovv) #45

What does NP stand for?


(nBurn) #46

It’s explained near the end of the addon’s PDF (there’s a download link on it’s wiki page):

NP is a generic abbreviation - N for ‘new’ or ‘novi’ in Serbian, P for ‘prototype’ or ‘proba’ in the same language. I was supposed to change it to just ‘N’ when it reaches maturity, but since i am never satisfied it is probably prescribed to NP. I was waiting to come up with a better name but it kind of stuck around and it seems kind of coolnow. I have some ideas for a new name but i have no plans to rush with the change.

Station was the one term that had all the essential characteristics i was going for. It is a one word / technical
nature / combining platform - like term. The other options were ‘package’, ‘set’, ‘collection’, ‘terminal’, etc.


(Okavango) #47

Hi vvoovv, sorry for the late response, nBurn beat me to it :slight_smile: There were some considerations for a new name but for the time being this abbreviation does the trick. If you are interested, all information on the background of the addon are in the chapter with the same name in the PDF.


(Okavango) #48

Hi everyone!

The addon has been accepted to Blender’s addons_contrib collection and is now a part of daily builds on Blender.org. It will also be a part of the upcoming 2.79 release candidate. Independently, you can download it on it’s Wiki page, together with the PDF documentation that goes with it. The version that got accepted is an updated 020 version with the following improvements:

Some code cleanup, with the help of meta-androcto, matali23 and mano-wii

Added panel renaming feature in addon settings - you can now choose the location of the addon panel in the toolshelf

Cleaner console output while operating - minor speed gain

Removed logging to UI toolprops panel while operating - less blender workload and a moderate speed gain

Slightly more precise roto-widget, with the help of nBurn

Corrected color of the numerics in point_distance operator - better visibility in a standard theme

Added ‘hold result’ feature to point_distance, following a suggestion by nBurn, quite nice feature

Added SNAP-TARGET toggle to float_poly, the user is now able to change the snapping target while operating, similar to point_distance

Some minor bugs fixed


(mkbreuer) #49

Congratulations! +1


(patoaltaco) #50

Great news!! Congrats okavango!!


(bekic.bojan) #51

Congrats, man, great job!


(matali) #52

Congrats, really usefull addon :slight_smile:


(Okavango) #53

Thank you guys, it’s nice to see your support. I hope i will be able to upgrade it further.


I would also like to appeal to all the people from CAD - architectural, mechanical and other technical backgrounds to be more vocal and take a larger part in the development discussions.

Right now we are very low under the radar of the development teams and constantly being overwhelmed by artistic community. Not saying artistic aspect of Blender is not important, on the contrary, it made Blender what it is today. On the other hand, CAD topics are fading into oblivion, lacking visible support. I noticed there are quite a few CAD members around these forums keeping a low profile and just taking what they need, without showing appreciation or support (to be completely honest, i was like that for some time). The resulting impression is that CAD features are not in the demand and that there are no serious benefits from implementing them in Blender.

There IS the need for CAD features and they are possible under the existing Blender tech! And will make Blender better, more versatile and appealing to professionals. Here are some topics you can support through comments and overall presence (sorry if i forgot any, feel free to remind me):

New concept of Blender templates, with the emphasis on the CAD template - don’t let this idea fade out! This is probably our main battle front, be vocal!

An ongoing discussion on possible implementation of transform navigation, started by mano-wii. This upgrade is an obvious and badly needed upgrade for precise modelling workflows and needs your immediate support.

Archipack by stephen_leger, a possible beginning of real parametric arch objects in Blender

Mechanical blender by mauge - a new fork of Blender with emphasis on technical features, with unit control, upgraded snapping, reference planes and dimensioning

CAD snap utilities by mano-wii - drawing addon with phenomenal openGL snapping made from scratch

Extrude and reshape by mano-wii - upgraded surface push-and-pull tool with snapping

Sverchok , parametric nodes for architects add-on (Rhinos Grasshopper alternative) who is taking some attention lately

GSoC 2016 - Improvements to Bezier Curves project it’s awaiting some review to be included (hopefully) into the upcoming 2.79 version of Blender

BlenderCAM project who have some interesting 5axis gcode output (in beta for now)

Direct Autocad-Intellicad to Blender exporter LISP made by 1D_inc. Can be of great use for architects.

Offset edges by Bon Baba, now a standard ‘CAD offset’ workaround for Blender

xOffsets by nBurn, a new, engeniring style approach to geometry control

Archimesh and Measure it by Antonioya

Edge Tools by zeffi and T+Align by mkbreuer

Mesh Align Plus by egtwobits and 1D_Scripts by 1D_inc

Layer manager by Alfonso Annarumma and mont29 - the best available workaround for CAD-like control of layers in Blender

The obvious grouping issues of Blender, tackled here. This thread withered out quickly with small response, emanating danger that this issues will not be addressed by developers.

A couple of issues initiated on Rclick Select site, thirsting for support. Rclick Select is the main message board for Blender suggestions.

Now is the right time, the major changes are happening as we speak, with the 2.8 evolution and will go on in the next few months. Speak up!


collectionProperty error on blenderstart custom UI list
(matali) #54

Totally agree, very good post. It’s not always easy to do everything one want in a day. I would need 48hours days :smiley: I was very quiet in the last month because of a lot of work. I’ll do my best to give more time for the community as soon as I can.


(theApe) #55

Marketing tip, if you want the Blender foundation to warm up to adding CAD-tools in Blender, don´t call them CAD-tools :wink: Sounds silly, but Ton seems to dislike everything CAD (yes, I know I´m exaggerating:) but apparently words like layers, mesh, align and snap tools sound very unthreatening to the Blender philosophy.


(Okavango) #56

Totally agree, very good post. It’s not always easy to do everything one want in a day. I would need 48hours days :smiley: I was very quiet in the last month because of a lot of work. I’ll do my best to give more time for the community as soon as I can.

There are a quarter of a million registered users on BA. There are 3 million downloads of Blender per half a year (let’s say standard upgrade cycle), let’s say one in 40 users need and use precise modelling (being pessimistic here). I am not talking about regularly present users like you matali, i was talking about these guys.

Marketing tip, if you want the Blender foundation to warm up to adding CAD-tools in Blender, don´t call them CAD-tools https://blenderartists.org/forum/images/smilies/sago/wink.gif Sounds silly, but Ton seems to dislike everything CAD (yes, I know I´m exaggeratinghttps://blenderartists.org/forum/images/smilies/sago/smile.gif but apparently words like layers, mesh, align and snap tools sound very unthreatening to the Blender philosophy.

Hahaha, didn’t know that one, thanks. I did talk to Ton once over irc though, asking for some advice. I showed him the tool gifs, he was very supportive.


(artisanicview) #57

I totally agree with you and I’m also very interested to push into the direction of having more CAD like tools into Blender.

The architects can have a lot of great use having ALL the basic artistic and technical tools in one single package. In Blender you can create a building and render a picture for visualisation. Or with the Armory3D project will be able to make an interactive walk-through the building, without the need to switch between packages. But will be beautiful to be able to do also the technical CAD part of things also in Blender.

Myself I’m envisioning a Blender that it’s allowing me to create all the necessary (technical) parts for furniture creation. Even if right now seems difficult, potentially Blender have all the building blocks required to achieve this.

As “Technical” projects for Blender, I would like to add to your list:

If we want to succeed we will need a better organisation, because to bring CAD tools in Blender will require some resources. Some users requested more features in Blender, like this one: Nurbs Modeling Addons? How? but because the lack of organisation they are going to a dead end.


(mkbreuer) #58

Hy Okavango!

Can you add a Marker or 2xCircle for Golden Ratio 1:1618… to Point Distance?
Often used for architect or other design stuff.
The image below, with a golden ratio circle tool, shows what i mean :


more explaination


(burnin) #59

Just a thought, an opinion… written down.

Ain’t ‘CAD’ an implication of a high precision software (double-float)?
Personally, am one of those who don’t like to (ab)use words like ‘CAD’, neither as a suggestion for blender modeling tools or any other DCC apps, because of confusion that it brings. ‘CAD’ became synonymous to ‘high precision’ in engineering.
With Blender you can’t easily make precise tools or semi-products - not even for watch- , jewelry- , … , detailed stuff-making. Now imagine something much bigger or smaller.
I accepted the fact and moved on…

ps
There are so many other namings, why get hung on this?


(Okavango) #60

The architects can have a lot of great use having ALL the basic artistic and technical tools in one single package. In Blender you can create a building and render a picture for visualisation. Or with the Armory3D project will be able to make an interactive walk-through the building, without the need to switch between packages. But will be beautiful to be able to do also the technical CAD part of things also in Blender.

Totally agree with you on this artisanicview, that would probably be the fastest and most efficient combination for precision users. You can imagine what architects think of having lightning fast precision sketching and Cycles-grade renderer in one place.

As “Technical” projects for Blender, I would like to add to your list:

  • BlenderCAM project who have some interesting 5axis gcode output (in beta for now).

Nice ones, added :slight_smile:

Hy Okavango!

Can you add a Marker or 2xCircle for Golden Ratio 1:1618… to Point Distance?
Often used for architect or other design stuff.
The image below, with a golden ratio circle tool, shows what i mean :

Hi mkbreuer, check the zip in the attachment if it does what you suggested.

Ain’t ‘CAD’ an implication of a high precision software (double-float)?
Personally, am one of those who don’t like to (ab)use words like ‘CAD’, neither as a suggestion for blender modeling tools or any other DCC apps, because of confusion that it brings. ‘CAD’ became synonymous to ‘high precision’ in engineering.
With Blender you can’t easily make precise tools or semi-products - not even for watch- , jewelry- , … , detailed stuff-making. Now imagine something much bigger or smaller.

You’re probably right burnin, though it seems CAD term took the place of ‘precision modelling’ in our everyday communication. Even one of the suggested Blender templates bares the term CAD. We are talking BriliantApe’s terms here, mentioned few posts up.

Attachments

np_station_2017_04_29_golden.zip (110 KB)