Book shelves Scripting

General project and community related discussions and offtopic threads.
Post Reply
User avatar
Sharlybg
Donor
Posts: 2155
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Book shelves Scripting

Post by Sharlybg » Wed Jul 01, 2020 12:21 pm

i am stuck with an issue. i'am trying to fill many bookshelves as fast as possible. i've look arround for Blender book gen addon ( Book Generator/Bookmaker/Bookwizard) but there is always this missing feature that make harder to use properlly (book shader+texture aren't realistic/sometime book model aren't very interesting).

My solution

1___ Model dozens of random book in blender (80 books) done

2___ Add textures and Luxcore shaders done

3___ Need a script to place them randomly along a given face.

Price will be that all books will be available in the next LOL update as free assets instead of patrons only ;)
books.jpg
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA

User avatar
B.Y.O.B.
Developer
Posts: 3681
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Book shelves Scripting

Post by B.Y.O.B. » Wed Jul 01, 2020 2:18 pm

I can write such a script, if you send me a scene with the book models (so I can check how the origin is positioned, how they are scaled etc.).

User avatar
Sharlybg
Donor
Posts: 2155
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Book shelves Scripting

Post by Sharlybg » Wed Jul 01, 2020 3:14 pm

B.Y.O.B. wrote:
Wed Jul 01, 2020 2:18 pm
I can write such a script, if you send me a scene with the book models (so I can check how the origin is positioned, how they are scaled etc.).
You're awesome !
Done via PM :D
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA

User avatar
Theo_Gottwald
Posts: 76
Joined: Fri Apr 24, 2020 12:01 pm

Re: Book shelves Scripting

Post by Theo_Gottwald » Tue Jul 21, 2020 2:37 pm

If you want to see Python examples on how to move things around in Blender, i can recommend you my "Library.py".
You can download the whole package here for free:

Theo's External AddOn plus Library

It contains 2 Parts:
1. The Library - anyone can use it. "Library.py" the video shows how Libraries are registered in Blender.
You can then add your own Subprogrammes there.

2. The "Blenderbar-AddOn". This one only works under windows. So its optional. You can see it on the picture below.
As it docs at the right side of Blender, its completely version independent. The library not, i have just updated it so it works until at least 2.90.

The Library is in the Library folder. It contains a lot of Scripting samples how to select objects, move them around etc.
Many of this already in easy to use Python-procedures.

You may however need to watch a bit of the video there to see how its used.

To use the AddOn, you should know that it works only under Windows and it needs a Python console in the lower right corner of Blender.
Because it will type Python commands there.

Watch the Buttons:
- "Mul" this will multiply the selected Object in a defined cubic space
- "Rot" this will give all selected objects a unique random rotation within a given Frame number (and within a Speed range)
- "Mov" this will give all selected objects "Move" in random direction (limits)....
- "Siz:" this will give all selected Objects a random size within limits ...
AddOn Picture.png
Best you take a look in the Textfiles - this is where the Python Code for each Button (and the Button-Text) is located.
Note that it calls Subprogramms in "Library.py" (Button "Open Library") will open the Library Folder.

For writing Python I can recommend Notepad++

Once you have the console in Blender open, you can start the AddOn, then press "Add Library".
This will register the Library Folder with Blender. The Free Public AddOn can have a total of maximum 20 Buttons which you can also put your own commands on.

If you want test the free AddOn. It is not limited other then it has only maximum 20 Buttons.
If you like it ... then read ...
There will be a new commercial add on, this will also include my desktops manager program (to have a own Desktop for each running Blender).
Technically this is all ready. It can handle 40 Buttons (self configurable) and multiple Levels (up to 9 Levels with each 40 Buttons).
So you can for example Make a Button-Level for Modelling, a Button-Level for Liquide-Simulation and a Level with your own functions for Rigid Body.
My current problem is that i do not yet have so many useful functions to put it on all the buttons - thats why its not yet on Blendermarket.
I will put it on Blendermarket when its ready. However if you like the AddOn, tell me.
Any Programmer and contributor for Luxrender can ask me and then get the big-AddOn (the one with 40 Buttons and multiple Levels)
for free (the blendermarket version). That includes my Desktops-Manager Program. The Library is the same in both packages.
Register @Dreamstime and sell your Renderings to the world.

Post Reply