RCG Init: migration from gitlab:robossembler/framework

This commit is contained in:
Игорь Брылёв 2024-12-10 16:25:56 +03:00
parent dc41dd5ab9
commit 768f372edc
94 changed files with 2126 additions and 84 deletions

View file

@ -0,0 +1,50 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Copyright (C) 2024 Ilia Kurochkin <brothermechanic@yandex.com>
#
# Created by Ilia Kurochkin (brothermechanic)
# contact: brothermechanic@yandex.com
#
# This is free software;
# you can redistribute it and/or modify
# it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# ***** END GPL LICENSE BLOCK *****
#
# coding: utf-8
'''
DESCRIPTION.
Blender object relations functions.
'''
__version__ = '0.1'
import bpy
def parenting(parent, child):
''' Parenting child object to parent object. '''
child.parent = parent
child.matrix_parent_inverse = parent.matrix_world.inverted()
return child
def unparenting(child):
''' Unarenting child object from parent object. '''
# update database
bpy.context.view_layer.update()
world_matrix = child.matrix_world.copy()
child.parent = None
child.matrix_world = world_matrix
return child