2023-07-21 11:39:01 +02:00
|
|
|
# CUSTOM_SHELF
|
|
|
|
> Blender addon to launch custom scripts from the User Panel
|
2022-03-04 12:12:43 +01:00
|
|
|
|
|
|
|
|
2023-07-21 11:39:01 +02:00
|
|
|
Pipe_test is a test repository that can be used by TDs to run code or development tests so as not to pollute the main repositories.
|
2022-03-04 12:12:43 +01:00
|
|
|
|
2023-07-21 11:39:01 +02:00
|
|
|
<!-- TABLE OF CONTENTS -->
|
|
|
|
***
|
|
|
|
<summary>Table of Contents</summary>
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
|
|
<a href="#installation">Installation</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#contents">Contents</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#usage">Usage</a>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- INSTALLATION -->
|
2022-03-04 12:12:43 +01:00
|
|
|
## Installation
|
|
|
|
|
2023-07-21 11:39:01 +02:00
|
|
|
1. Create your own local directory in
|
|
|
|
```sh
|
|
|
|
/home/<USER>/dev
|
|
|
|
```
|
|
|
|
2. Create your own local directory in
|
|
|
|
```sh
|
2023-10-03 11:54:36 +02:00
|
|
|
git clone ssh://git@git.autourdeminuit.com:222/autour_de_minuit/custom_shelf.git
|
2023-07-21 11:39:01 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
<!-- CONTENTS -->
|
|
|
|
## Contents
|
2022-03-04 12:12:43 +01:00
|
|
|
|
2023-07-21 11:39:01 +02:00
|
|
|
<!-- USAGE -->
|
2022-03-04 12:57:58 +01:00
|
|
|
## Usage
|
2022-03-04 12:12:43 +01:00
|
|
|
|
2022-03-16 11:22:40 +01:00
|
|
|
Place your .py scripts in the `shelves/` folder with following folder structure:
|
|
|
|
|
|
|
|
`shelves / sidebar_tab_name / panel_name / button_name.py`
|
|
|
|
|
|
|
|
Here is the dictionnary to put at the beginning of your code to have tooltip, icon
|
|
|
|
and variables inside a popup:
|
|
|
|
|
|
|
|
```
|
|
|
|
info = {
|
|
|
|
'icon' : 'SORTALPHA',
|
|
|
|
'description' : 'Rename active object in something',
|
|
|
|
'name' : 'Some name',
|
|
|
|
'enum' : {'value': '3', 'items': ['1', '2', '3', '4']},
|
|
|
|
'int' : 2,
|
|
|
|
'path' : '/temp',
|
|
|
|
'bool' : False,
|
|
|
|
'float' : 2.0,
|
|
|
|
'collection' : {'value': 'object', 'collection': 'Object'},
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
To get yout variables in your code :
|
|
|
|
|
|
|
|
`name = info['name']`
|
|
|
|
|
|
|
|
The collection return the name, so to get an object :
|
|
|
|
|
|
|
|
`ob = bpy.data.objects.get(info['collection']['value'])`
|
|
|
|
|
|
|
|
You can next filter by tags by clicking on the arrow icon
|