forked from bartvdbraak/blender
31a620b942
This encapsulates Node socket members behind a set of specific methods; as such it is no longer possible to directly access Node class members from exporters and parts of Cycles. The methods are defined via the NODE_SOCKET_API macros in `graph/ node.h`, and are for getting or setting a specific socket's value, as well as querying or modifying the state of its update flag. The setters will check whether the value has changed and tag the socket as modified appropriately. This will let us know how a Node has changed and what to update, which is the first concrete step toward a more granular scene update system. Since the setters will tag the Node sockets as modified when passed different data, this patch also removes the various modified methods on Nodes in favor of Node::is_modified which checks the sockets' update flags status. Reviewed By: brecht Maniphest Tasks: T79174 Differential Revision: https://developer.blender.org/D8544
39 lines
946 B
C++
39 lines
946 B
C++
/*
|
|
* Copyright 2020 Blender Foundation
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "graph/node.h"
|
|
|
|
#include "render/mesh.h"
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
class Volume : public Mesh {
|
|
public:
|
|
NODE_DECLARE
|
|
|
|
Volume();
|
|
|
|
NODE_SOCKET_API(float, clipping)
|
|
NODE_SOCKET_API(float, step_size)
|
|
NODE_SOCKET_API(bool, object_space)
|
|
|
|
virtual void clear(bool preserve_shaders = false) override;
|
|
};
|
|
|
|
CCL_NAMESPACE_END
|