Skip to content

Commit

Permalink
Merge branch 'update_2_1_3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Tugcga committed Aug 6, 2023
2 parents 70358e9 + d2a0675 commit f440929
Show file tree
Hide file tree
Showing 21 changed files with 577 additions and 112 deletions.
6 changes: 0 additions & 6 deletions Application/Plugins/CyclesPropertiesPlugin.py
Expand Up @@ -285,7 +285,6 @@ def CyclesVolume_Define(in_ctxt):

def CyclesPointcloud_Define(in_ctxt):
prop = in_ctxt.Source
prop.AddParameter3("tip_prop", c.siFloat, 0.0, 0.0, 1.0)
prop.AddParameter3("primitive_pc", c.siBool, False)
prop.AddParameter3("use_pc_color", c.siBool, True)
setup_common_properties(prop)
Expand Down Expand Up @@ -621,10 +620,8 @@ def cycles_volume_property_build_ui():
def pointcloud_ui_update(prop):
primitive_pc = prop.Parameters("primitive_pc").Value
if primitive_pc:
prop.Parameters("tip_prop").ReadOnly = True
prop.Parameters("use_pc_color").ReadOnly = True
else:
prop.Parameters("tip_prop").ReadOnly = False
prop.Parameters("use_pc_color").ReadOnly = False


Expand All @@ -637,9 +634,6 @@ def cycles_pointcloud_property_build_ui():
layout.AddGroup("Particles")
layout.AddItem("primitive_pc", "Native Cycles Pointcloud")
layout.EndGroup()
layout.AddGroup("Strands")
layout.AddItem("tip_prop", "Tip Proportion")
layout.EndGroup()
layout.AddGroup("Pointcloud")
layout.AddItem("use_pc_color", "Override Pointcloud Color")
layout.EndGroup()
Expand Down
3 changes: 2 additions & 1 deletion Application/Plugins/config.ini
Expand Up @@ -6,10 +6,11 @@ glossy_bounces = 2
transmission_bounces = 2
transparent_bounces = 2
volume_bounces = 2
use_ocl = 1
use_ocl = 1; 0 - use svm, 1 - use ocl
clamp_direct = 1.0
clamp_indirect = 1.0
displacement_method = 2; 0 - bump, 1 - only displacement, 2 - both
use_gpu = 0; 0 - cpu, 1 - one gpu device (optix if it exists)
[Render]
devices = 16; render devices count
[SeriesRendering]
Expand Down
127 changes: 127 additions & 0 deletions Data/Compounds/Set Strand Profile.xsicompound
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsi_file type="CompoundNode" name="Set Strand Profile" category="Sycles" formatversion="1.4" compoundversion="1.0" backgroundcolor="10468505">
<definition>
<nodes>
<node type="Set Data" version="1.0" index="0">
<param name="Reference" type="31" value="self.StrandSize"></param>
<param name="Value" type="4" value="0.000000"></param>
<param_ext name="Reference" type="31" value="self.StrandSize"></param_ext>
<portdef name="In_Name" type="8192" structure="1" group="-1" instance="-1" port="-1"></portdef>
<portdef name="Value" type="4" structure="2" group="2" instance="0" port="0" groupname="Value"></portdef>
<datablob category="ui_infos">
<prop name="posx">406</prop>
<prop name="posy">339</prop>
<prop name="state">Normal</prop>
</datablob>
</node>
<node type="Build Linearly Interpolated Array" version="1.1" index="1">
<param name="Size" type="3" value="10"></param>
<param name="Start" type="4" value="0.000000"></param>
<param name="End" type="4" value="1.000000"></param>
<portdef name="Size" type="2" structure="1" group="-1" instance="-1" port="-1"></portdef>
<portdef name="Start" type="4" structure="1" group="-1" instance="-1" port="-1"></portdef>
<portdef name="End" type="4" structure="1" group="-1" instance="-1" port="-1"></portdef>
<datablob category="ui_infos">
<prop name="posx">-210</prop>
<prop name="posy">341</prop>
<prop name="state">Normal</prop>
</datablob>
</node>
<node type="ScalarNode" index="2">
<param name="value" type="4" value="0.100000"></param>
<portdef name="value" type="4" structure="1" group="0" instance="0" port="0"></portdef>
<datablob category="ui_infos">
<prop name="posx">76</prop>
<prop name="posy">487</prop>
<prop name="state">Normal</prop>
</datablob>
</node>
<node type="IntegerNode" index="3">
<param name="value" type="3" value="1"></param>
<portdef name="value" type="2" structure="1" group="0" instance="0" port="0"></portdef>
<datablob category="ui_infos">
<prop name="posx">-497</prop>
<prop name="posy">373</prop>
<prop name="state">Normal</prop>
</datablob>
</node>
<node type="FCurveNode" index="4">
<param name="profile" type="buffer">2 20 1 0 -1.79769E+308 1.79769E+308 2 0
0 0.000000 1.000000 0.333333 0.000000 -0.333333 0.000000 4 2
0 1.000000 0.000000 0.333333 0.000000 -0.333333 0.000000 4 2
</param>
<param name="in" type="4" value="0.000000"></param>
<portdef name="in" type="4" structure="2" group="0" instance="0" port="0"></portdef>
<datablob category="ui_infos">
<prop name="posx">73</prop>
<prop name="posy">371</prop>
<prop name="state">Normal</prop>
</datablob>
</node>
<node type="GetArraySizeNode" index="5">
<param name="array.array_x" type="4" value="0.000000"></param>
<param name="array.array_y" type="4" value="0.000000"></param>
<param name="array.array_z" type="4" value="0.000000"></param>
<portdef name="array" type="16" structure="2" group="0" instance="0" port="0"></portdef>
<datablob category="ui_infos">
<prop name="posx">-512</prop>
<prop name="posy">301</prop>
<prop name="state">Normal</prop>
</datablob>
</node>
<node type="AddNode" index="6">
<param name="value1" type="3" value="0"></param>
<param name="value2" type="3" value="1"></param>
<portdef name="value1" type="2" structure="1" group="0" instance="0" port="0"></portdef>
<portdef name="value2" type="2" structure="1" group="0" instance="1" port="0"></portdef>
<datablob category="ui_infos">
<prop name="posx">-346</prop>
<prop name="posy">300</prop>
<prop name="state">Normal</prop>
</datablob>
</node>
<node type="MultiplyByScalarNode" index="7">
<param name="value" type="4" value="0.000000"></param>
<param name="factor" type="4" value="1.000000"></param>
<portdef name="value" type="4" structure="2" group="0" instance="0" port="0"></portdef>
<portdef name="factor" type="4" structure="1" group="0" instance="0" port="1"></portdef>
<datablob category="ui_infos">
<prop name="posx">215</prop>
<prop name="posy">365</prop>
<prop name="state">Normal</prop>
</datablob>
</node>
<node type="GetDataNode" index="8">
<param name="reference" type="31" value="self.StrandPosition"></param>
<param_ext name="reference" type="31" value="self.StrandPosition"></param_ext>
<portdef name="source" type="2048" structure="1" group="1" instance="0" port="0"></portdef>
<portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
<datablob category="ui_infos">
<prop name="posx">-755</prop>
<prop name="posy">296</prop>
<prop name="state">Normal</prop>
</datablob>
</node>
</nodes>
<exposed_ports>
<port index="0" portname="Execute" username="Execute" basename="Execute" portlabel="Execute" exposetype="single"> </port>
<port index="2" portname="value" username="Size" basename="Size" portlabel="Size" exposetype="single"> </port>
<port index="4" portname="profile" username="Profile" basename="Profile" portlabel="Profile" exposetype="single"> </port>
</exposed_ports>
<connections>
<cnx from_node="1" from_port="Result" to_node="4" to_port="in"> </cnx>
<cnx from_node="2" from_port="result" to_node="7" to_port="factor"> </cnx>
<cnx from_node="3" from_port="result" to_node="6" to_port="value2"> </cnx>
<cnx from_node="4" from_port="out" to_node="7" to_port="value"> </cnx>
<cnx from_node="5" from_port="size" to_node="6" to_port="value1"> </cnx>
<cnx from_node="6" from_port="result" to_node="1" to_port="Size"> </cnx>
<cnx from_node="7" from_port="result" to_node="0" to_port="Value"> </cnx>
<cnx from_node="8" from_port="value" to_node="5" to_port="array"> </cnx>
</connections>
<layout>
<item type="input" name="Size" min="0" max="1.0"> </item>
<item type="input" name="Profile"> </item>
<item type="output" name="Execute"> </item>
</layout>
</definition>
</xsi_file>
1 change: 1 addition & 0 deletions src/input/config_ini.h
Expand Up @@ -14,6 +14,7 @@ struct ConfigShaderball
float clamp_direct;
float clamp_indirect;
ULONG displacement_method;
bool use_gpu;
};

struct ConfigRender
Expand Down
4 changes: 4 additions & 0 deletions src/input/input.cpp
Expand Up @@ -152,6 +152,10 @@ void read_config_ini()
const char* displacement_method_str = ini.GetValue("Shaderball", "displacement_method", "2");
shaderball.displacement_method = std::max(0, std::min(2, std::stoi(displacement_method_str, nullptr)));

const char* use_gpu_str = ini.GetValue("Shaderball", "use_gpu", "0"); // by default gpu is off, ise only cpu for material previes
const float use_gpu_float = strtof(use_gpu_str, nullptr);
shaderball.use_gpu = use_gpu_float >= 0.5;

ConfigRender render;
const char* devices_str = ini.GetValue("Render", "devices", "16");
render.devices = std::stoi(devices_str, nullptr);
Expand Down
3 changes: 3 additions & 0 deletions src/render_cycles/cyc_scene/cyc_geometry/cyc_hair.cpp
Expand Up @@ -15,6 +15,7 @@
#include "../../../utilities/xsi_properties.h"
#include "../../../utilities/math.h"
#include "../../../utilities/logs.h"
#include "../../../utilities/strings.h"
#include "../cyc_scene.h"
#include "cyc_geometry.h"

Expand Down Expand Up @@ -416,6 +417,8 @@ void sync_hair_motion_deform(ccl::Hair* hair, UpdateContext* update_context, con

void sync_hair_geom_process(ccl::Scene* scene, ccl::Hair* hair_geom, UpdateContext* update_context, const XSI::HairPrimitive &xsi_hair, XSI::X3DObject &xsi_object, bool motion_deform)
{
hair_geom->name = combine_geometry_name(xsi_object, xsi_hair).GetAsciiString();

ccl::vector<ccl::float4> original_positions; // save here positions for motion invalid attributes
LONG num_keys = 0;
bool use_motion_blur = update_context->get_need_motion() && motion_deform;
Expand Down
3 changes: 3 additions & 0 deletions src/render_cycles/cyc_scene/cyc_geometry/cyc_points.cpp
Expand Up @@ -20,6 +20,7 @@
#include "cyc_geometry.h"
#include "../cyc_scene.h"
#include "../../../utilities/math.h"
#include "../../../utilities/strings.h"

bool is_pointcloud_points(XSI::X3DObject &xsi_object, const XSI::CTime &eval_time)
{
Expand Down Expand Up @@ -224,6 +225,8 @@ void sync_points_deform(ccl::PointCloud* points_geom, UpdateContext* update_cont

void sync_points_geom_process(ccl::Scene* scene, ccl::PointCloud* points_geom, UpdateContext* update_context, const XSI::Primitive& xsi_primitive, XSI::X3DObject& xsi_object, bool motion_deform)
{
points_geom->name = combine_geometry_name(xsi_object, xsi_primitive).GetAsciiString();

ccl::vector<ccl::float3> original_positions;
bool use_motion_blur = update_context->get_need_motion() && motion_deform;

Expand Down
1 change: 1 addition & 0 deletions src/render_cycles/cyc_scene/cyc_geometry/cyc_polymesh.cpp
Expand Up @@ -558,6 +558,7 @@ void sync_polymesh_process(ccl::Scene* scene, ccl::Mesh* mesh_geom, UpdateContex
{
// geometry is new, create it
XSI::PolygonMesh xsi_polymesh = xsi_primitive.GetGeometry(eval_time, XSI::siConstructionModeSecondaryShape);
mesh_geom->name = combine_geometry_name(xsi_object, xsi_polymesh).GetAsciiString();

// get geometry property
XSI::Property geo_property;
Expand Down

0 comments on commit f440929

Please sign in to comment.