Blender Pricing Script

Discussion in 'Software and Applications' started by 16672_deleted, Mar 25, 2009.

  1. 16672_deleted
    16672_deleted Member
    Inspired somewhat by the 3DS Max utility, I present the Blender calculator for Shapeways costs (attachment).

    Requires Blender v2.48a or later

    v0.7 (8/28/2009):
    Added Dyed WSF and Polished Stainless materials
    WSF will add $1.50 to calculated price regardless of size, so don't worry about the price per cm3 not multiplying into the total
    Similarly, dyed WSF will add $4 to calculated price
    Changed WSF pricing to $1.50/cm3
    An issue may arise when going from 0.6 to 0.7 with saved settings because of extra buttons... if something looks "wonky" when it loads, change to your preferred settings and exit, then run the script again.
    v0.6 (4/28/2009):
    Fixed a scaling/translation bug
    v0.5 (4/23/2009):
    Better script cleanup
    Changed GUI to single column, contracting sections
    Added Blender registry entries for persistent settings
    Added changeable material prices
    Added manifold check
    Added polygon count (current and triangulated)
    Added selection dimensions
    Fixed Blender unit scale errors: exponent was wrong, and reversed between millimetres and metres
    Slightly better support for scaling and translation calculation
    v0.4 (3/30/2009):
    Some script cleanup
    Using popup GUI form rather than script window. The new form should fit on screen more reliably
    v0.3 (3/27/2009):
    Fixed resizing calculation bug
    v0.2:
    Added GUI with changeable options, VAT and markup calculation, and resizing calculation
    Added quad support in addition to tris
    Scaling applied without manual application
    v0.1:
    Basic calculation sent to console window

    Preview:
    [​IMG]

    To install: extract the .py file to the base blender working directory (this may be your installation path, AppData, %HOME%, or something else on another O/S. Then start up Blender, it should be in the object->scripts menu.

    It will generally go to 1 of 2 places in Windows
    Example 1:
    C:\Program Files\Blender Foundation\Blender\.blender\scripts\
    Example 2:
    Vista:
    C:\Users\username\AppData\Roaming\Blender Foundation\Blender\.blender\scripts\
    XP:
    C:\Documents And Settings\username\Application Data\Blender Foundation\Blender\.blender\scripts\

    To use: Select the objects you want to calculate, and run the script as shown here:

    [​IMG]

    This will display the GUI which should be self-explanatory. Let me know if anything could be explained easier.

    I'm working on a normal check and trying to figure out a wallthickness calculation, so I may update with that in a few weeks.

    I'll appreciate feedback; especially if something doesn't work.
     

    Attached Files:

    Last edited: Aug 28, 2009
  2. joris
    joris Member
    Loonsbury: in a word: this is so so so cool.

    Thank you!

    Joris
     
  3. bartv
    bartv Member
  4. 16672_deleted
    16672_deleted Member
    :edit: Updated to v0.3
     
    Last edited: Mar 28, 2009
  5. Wow that's great and it works fine.

    However I have a problem:

    I have extracted the .blender file to the base blender working directory and this inactive other scripts (thus limits my use of Blender because now I can not open .obj files).

    Do I do something wrong ?
     
    Last edited: Mar 28, 2009
  6. 16672_deleted
    16672_deleted Member
    Yikes. If you replaced the .blender subdirectory with the one in the .zip file, yes. There is only one file in here, intended to go into .blender/scripts/

    You may need to reinstall blender to get the default scripts back again - it should keep your settings though.
     
  7. No I didn't do this because I had no file .blender, other scripts are placed in a folder called python25.zip

    I have extracted your .blender file to the base blender working directory and this inactive other scripts which are placed in the folder called python25.zip.

    I tried to extract your .blender file to the folder called python25.zip but your script doesn't appear in the object->scripts menu.


     
    Last edited: Mar 28, 2009
  8. 16672_deleted
    16672_deleted Member
    Hmm... what O/S and Blender version are you running? I don't really get what your file structure looks like.
     
  9. Thanks Loonsbury.

    My OS is Vista 32 bits and the Blender version is 248.1

    See attached file for file structure.

    file structure.jpg
     
  10. 16672_deleted
    16672_deleted Member
    Oh, now that I look at my own directory it makes sense. Python25.zip doesn't have any scripts that Blender uses as far as I know. Your scripts are probably located in your appdata folder.

    C:\Users\username\AppData\Roaming\Blender Foundation\Blender
     
  11. Wow, you were absolutly right and now everything works fine :D
    Thank you so much for your help and for this very very cool and useful script.
     
  12. 16672_deleted
    16672_deleted Member
    Updated to v0.3, notes in OP
     
    Last edited: Mar 28, 2009
  13. bartv
    bartv Member
    Hey Loonsbury,

    I think this script is very useful also for Blender users who don't use Shapeways. Once you're happy with it, please contact me on bart(at)blendernation(dot)com and I'll do a proper post about it.

    Thanks!

    Bart
     
  14. 16672_deleted
    16672_deleted Member
    Updated to v0.4, notes in OP
     
  15. 16893_deleted
    16893_deleted Member
    Hi there,

    I'm a little confused about the m, cm and mm buttons. They seem to operate the opposite way to how I expected. For example, if my model has the dimensions 50 x 50 x 50 in the properties, I expect the mm button to calculate price for a 50mm x 50mm x 50mm print and the cm button to be a 50 cm^3 print, but the price goes down, not up. I think it would be helpful to be able to see the xyz dimensions of the model in the applet window as a sanity check. Am I looking at this the wrong way?

    Also, while I'm at it, it would be helpful to support user input of material cost so when Shapeways drops the price or includes a new material, we can input the current value.

    FYI, it didn't run properly on my old version of Blender (early 2008) so I had to upgrade. And it took me a while to find the script in the scripts->objects sub menu, so mentioning that in the posts might save someone else some hunting.

    Thanks for all your work on this.

    John Gomm
     
  16. 10296_deleted
    10296_deleted Member
    Thanks for the reminder, I'd forgotten to come and ask about this. I'm seeing the same behavior in the size options. It does seem like the options operate opposite of what they should. Though perhaps I'm thinking about it the wrong way?
     
  17. 16672_deleted
    16672_deleted Member
    Not sure if I'm understanding right, when you go from mm to cm, the price goes down? I just tested it on my installation and it worked right, maybe I'm overlooking something.

    Good ideas, these will be in the next revision

    What version of blender had the problem? I'll also try to be more clear about the location of the script.
     
  18. 16893_deleted
    16893_deleted Member
    Sorry, don't remember the version of blender I was running before. A quick look at a saved file in wordpad makes me think it was 2.4.7 and I'm not sure I didn't overwrite some critical directory structure when I unzipped your file. I'm running 2.4.8 now on WinXP

    For example, my model's volume reads 804 cm3 in "cm" mode, 804245 cm3 in "mm" mode and 0.0 cm3 in "m" mode. The pricing is similarly $0 in "m" mode! Now that's a price I wouldn't be able to resist for a meter big model!

    Thanks for the quick reply

    John Gomm
     
  19. 16672_deleted
    16672_deleted Member
    Updated to v0.5, notes in OP
     
  20. 4723_deleted
    4723_deleted Member
    the zip file is corrupt