Skip to content

Commit

Permalink
LYNX | HOUDINI | LYNX_fabric.hda The twist randomize settings in LYNX…
Browse files Browse the repository at this point in the history
…_fabric_thread can now randomize twist offsets and twist counts for both fibers and threads.
  • Loading branch information
LucaScheller committed Aug 5, 2019
1 parent 5bf70d4 commit aa12410
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 32 deletions.
8 changes: 4 additions & 4 deletions HOUDINI/HSITE/otls/LYNX_fabric.hda/INDEX__SECTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Inputs: 1 to 1
Subnet: true
Python: false
Empty: false
Modified: Sat Mar 16 05:27:20 2019
Modified: Thu Mar 14 16:27:20 2019

Operator: LYNX::LYNX_fabric_convert::1.0
Label: LYNX fabric convert
Expand Down Expand Up @@ -38,7 +38,7 @@ Inputs: 0 to 1
Subnet: true
Python: false
Empty: false
Modified: Sun Mar 17 21:12:51 2019
Modified: Sat Mar 16 08:12:51 2019

Operator: LYNX::LYNX_fabric_resample::1.0
Label: LYNX fabric resample
Expand Down Expand Up @@ -108,7 +108,7 @@ Inputs: 0 to 2
Subnet: true
Python: false
Empty: false
Modified: Sat Mar 16 06:11:12 2019
Modified: Thu Mar 14 17:11:12 2019

Operator: LYNX::LYNX_fabric_pattern::1.1
Label: LYNX fabric pattern
Expand Down Expand Up @@ -150,7 +150,7 @@ Inputs: 2 to 2
Subnet: true
Python: false
Empty: false
Modified: Sat Aug 3 12:53:11 2019
Modified: Mon Aug 5 20:33:17 2019

Operator: LYNX::LYNX_fabric_thread_profile::1.1
Label: LYNX fabric thread profile
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sopflags sopflags =
comment ""
position -1.09831 -12.2477
connectornextid 3
flags = lock off model off template off footprint off xray off bypass off display on render on highlight off unload off savedata off compress on colordefault on exposed on
flags = lock off model off template off footprint off xray off bypass off display off render off highlight off unload off savedata off compress on colordefault on exposed on
outputsNamed3
{
0 "output1"
Expand All @@ -52,7 +52,7 @@ inputs
stat
{
create 1560896659
modify 1564829557
modify 1565029965
author [email protected]
access 0777
}
Expand Down Expand Up @@ -213,7 +213,7 @@ inputs
stat
{
create 1552418958
modify 1560018211
modify 1565024422
author LYNX@LucaScheller
access 0777
}
Expand All @@ -237,6 +237,9 @@ vex_threadjobsize [ 0 locks=0 ] ( 1024 )
snippet [ 0 locks=0 ] ( "float LYNX_fabric_fiber_twist_random_seed = ch(\"../fabric_fiber_twist_random_seed\");
float LYNX_fabric_fiber_twist_random_min = ch(\"../fabric_fiber_twist_random_min\");
float LYNX_fabric_fiber_twist_random_max = ch(\"../fabric_fiber_twist_random_max\");
float LYNX_fabric_fiber_twist_offset_random_seed = ch(\"../fabric_fiber_twist_offset_random_seed\");
float LYNX_fabric_fiber_twist_offset_random_min = ch(\"../fabric_fiber_twist_offset_random_min\");
float LYNX_fabric_fiber_twist_offset_random_max = ch(\"../fabric_fiber_twist_offset_random_max\");
float LYNX_fabric_fiber_offset = ch(\"../fabric_fiber_offset\");
float LYNX_fabric_fiber_offset_random_seed = ch(\"../fabric_fiber_offset_random_seed\");
float LYNX_fabric_fiber_offset_random_min = ch(\"../fabric_fiber_offset_random_min\");
Expand All @@ -247,12 +250,15 @@ float LYNX_fabric_fiber_offset_noise_min = ch(\"../fabric_fiber_offset_n
float LYNX_fabric_fiber_offset_noise_max = ch(\"../fabric_fiber_offset_noise_max\");
int LYNX_fabric_fiber_offset_remap_reverse = chi(\"../fabric_fiber_offset_remap_reverse\");
int LYNX_fabric_thread_twist_scale_post_toggle = chi(\"../fabric_thread_twist_scale_post_toggle\");
float LYNX_fabric_thread_twist_offset = ch(\"../fabric_thread_twist_offset\");
float LYNX_fabric_thread_twist = ch(\"../fabric_thread_twist\");
float LYNX_fabric_thread_twist_random_seed = ch(\"../fabric_thread_twist_random_seed\");
float LYNX_fabric_thread_twist_random_min = ch(\"../fabric_thread_twist_random_min\");
float LYNX_fabric_thread_twist_random_max = ch(\"../fabric_thread_twist_random_max\");
int LYNX_fabric_thread_twist_remap_reverse = chi(\"../fabric_thread_twist_remap_reverse\");
float LYNX_fabric_thread_twist_offset = ch(\"../fabric_thread_twist_offset\");
float LYNX_fabric_thread_twist_offset_random_seed = ch(\"../fabric_thread_twist_offset_random_seed\");
float LYNX_fabric_thread_twist_offset_random_min = ch(\"../fabric_thread_twist_offset_random_min\");
float LYNX_fabric_thread_twist_offset_random_max = ch(\"../fabric_thread_twist_offset_random_max\");

vector @P;
float @width = 0;
Expand All @@ -270,10 +276,9 @@ float LYNX_fabric_thread_width = point(1,\"width\",@LYNX_fabric_target);
vector LYNX_fabric_thread_scale = haspointattrib(1,\"scale\")?point(1,\"scale\",@LYNX_fabric_target):set(1,1,1);

// Calc Attr
float LYNX_fabric_fiber_twists = 360 * .1 * fit01(rand(rand(@LYNX_fabric_id_fiber)+LYNX_fabric_fiber_twist_random_seed),LYNX_fabric_fiber_twist_random_min,LYNX_fabric_fiber_twist_random_max);
float LYNX_fabric_thread_twists_uv = clamp(LYNX_fabric_thread_twist_remap_reverse?LYNX_fabric_thread_uv[0]:(1-LYNX_fabric_thread_uv[0]),0,1);
float LYNX_fabric_thread_twists = LYNX_fabric_thread_twist + fit01(rand(rand(@LYNX_fabric_id_thread)+LYNX_fabric_thread_twist_random_seed),LYNX_fabric_thread_twist_random_min,LYNX_fabric_thread_twist_random_max);
float LYNX_fabric_twists = LYNX_fabric_thread_twist_offset + LYNX_fabric_fiber_twists + LYNX_fabric_thread_twists * 360 * chramp(\"../fabric_thread_twist_remap\",LYNX_fabric_thread_twists_uv);
float LYNX_fabric_twists = LYNX_fabric_thread_twist_offset + fit01(rand(rand(@LYNX_fabric_id_thread)+LYNX_fabric_thread_twist_offset_random_seed),LYNX_fabric_thread_twist_offset_random_min,LYNX_fabric_thread_twist_offset_random_max) + fit01(rand(rand(@LYNX_fabric_id_fiber+10)+LYNX_fabric_fiber_twist_offset_random_seed),LYNX_fabric_fiber_twist_offset_random_min,LYNX_fabric_fiber_twist_offset_random_max);
LYNX_fabric_twists += (LYNX_fabric_thread_twist * fit01(rand(rand(@LYNX_fabric_id_thread+20)+LYNX_fabric_thread_twist_random_seed),LYNX_fabric_thread_twist_random_min,LYNX_fabric_thread_twist_random_max) * fit01(rand(rand(@LYNX_fabric_id_fiber+30)+LYNX_fabric_fiber_twist_random_seed),LYNX_fabric_fiber_twist_random_min,LYNX_fabric_fiber_twist_random_max)) * 360 * chramp(\"../fabric_thread_twist_remap\",LYNX_fabric_thread_twists_uv);

float LYNX_fabric_fiber_offset_uv = clamp(LYNX_fabric_fiber_offset_remap_reverse?LYNX_fabric_thread_uv[0]:(1-LYNX_fabric_thread_uv[0]),0,1);
float LYNX_fabric_fiber_offset_random = fit01(rand(rand(@LYNX_fabric_id_fiber) + LYNX_fabric_fiber_offset_random_seed), LYNX_fabric_fiber_offset_random_min, LYNX_fabric_fiber_offset_random_max);
Expand Down Expand Up @@ -1062,7 +1067,7 @@ inputs
stat
{
create 1552418958
modify 1560018211
modify 1565024864
author LYNX@LucaScheller
access 0777
}
Expand Down Expand Up @@ -1096,7 +1101,7 @@ vector LYNX_fabric_thread_uv = @uv;

// Calc Attr
float LYNX_fabric_thread_twists_uv = clamp(LYNX_fabric_thread_twist_remap_reverse?LYNX_fabric_thread_uv[0]:(1-LYNX_fabric_thread_uv[0]),0,1);
float LYNX_fabric_thread_twists = LYNX_fabric_thread_twist + fit01(rand(rand(@LYNX_fabric_id_thread)+LYNX_fabric_thread_twist_random_seed),LYNX_fabric_thread_twist_random_min,LYNX_fabric_thread_twist_random_max);
float LYNX_fabric_thread_twists = LYNX_fabric_thread_twist * fit01(rand(rand(@LYNX_fabric_id_thread+20)+LYNX_fabric_thread_twist_random_seed),LYNX_fabric_thread_twist_random_min,LYNX_fabric_thread_twist_random_max);
@LYNX_fabric_thread_twists = LYNX_fabric_thread_twists * 360 * chramp(\"../fabric_thread_twist_remap\",LYNX_fabric_thread_twists_uv);
" )
exportlist [ 0 locks=0 ] ( * )
Expand Down Expand Up @@ -1382,7 +1387,7 @@ inputs
stat
{
create 1559061581
modify 1564829555
modify 1565029738
author LYNX@LucaScheller
access 0777
}
Expand Down Expand Up @@ -1466,7 +1471,7 @@ inputs
stat
{
create 1559996359
modify 1564829555
modify 1565029738
author [email protected]
access 0777
}
Expand Down Expand Up @@ -2004,7 +2009,7 @@ Content-Type: text/plain

{
version 0.8
input [ 8 locks=0 ] ( [ input 1 ] )
input [ 8 locks=0 ] ( [ input 0 ] )
}

--HOUDINIMIMEBOUNDARY0xD3ADD339-0x00000F49-0x56B122C9-0x00000001HOUDINIMIMEBOUNDARY
Expand Down Expand Up @@ -2083,7 +2088,7 @@ Content-Type: text/plain

{
version 0.8
input [ 0 locks=0 ] ( [ input 1 ] )
input [ 0 locks=0 ] ( [ input 0 ] )
}

--HOUDINIMIMEBOUNDARY0xD3ADD339-0x00000F49-0x56B122C9-0x00000001HOUDINIMIMEBOUNDARY
Expand Down Expand Up @@ -2162,7 +2167,7 @@ Content-Type: text/plain

{
version 0.8
input [ 0 locks=0 ] ( [ input 1 ] )
input [ 0 locks=0 ] ( [ input 0 ] )
}

--HOUDINIMIMEBOUNDARY0xD3ADD339-0x00000F49-0x56B122C9-0x00000001HOUDINIMIMEBOUNDARY
Expand Down Expand Up @@ -2369,7 +2374,7 @@ Content-Type: text/plain

{
version 0.8
input [ 0 locks=0 ] ( [ input 1 ] )
input [ 0 locks=0 ] ( [ input 0 ] )
}

--HOUDINIMIMEBOUNDARY0xD3ADD339-0x00000F49-0x56B122C9-0x00000001HOUDINIMIMEBOUNDARY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@
label "Randomize"
grouptag { "group_type" "simple" }

parm {
name "Randomize_Twist_Fiber_Cycles"
label "Randomize Twist Cycles"
type label
joinnext
default { "" }
}
parm {
name "fabric_fiber_twist_random_seed"
label "Seed"
Expand All @@ -152,15 +159,45 @@
label "Min"
type float
joinnext
default { "0" }
range { -1 1 }
default { "1" }
range { 0 2 }
}
parm {
name "fabric_fiber_twist_random_max"
label "Max"
type float
default { "1" }
range { 0 2 }
}
parm {
name "Randomize_Twist_Fiber_Offset"
label "Randomize Twist Offset"
type label
joinnext
default { "" }
}
parm {
name "fabric_fiber_twist_offset_random_seed"
label "Seed"
type float
joinnext
default { "0" }
range { 0 10 }
}
parm {
name "fabric_fiber_twist_offset_random_min"
label "Min"
type float
joinnext
default { "0" }
range { -1 1 }
range { -360 360 }
}
parm {
name "fabric_fiber_twist_offset_random_max"
label "Max"
type float
default { "0" }
range { -360 360 }
}
}

Expand Down Expand Up @@ -315,6 +352,13 @@
label "Randomize"
grouptag { "group_type" "simple" }

parm {
name "Randomize_Twist_Thread_Cycles"
label "Randomize Twist Cycles"
type label
joinnext
default { "" }
}
parm {
name "fabric_thread_twist_random_seed"
label "Seed"
Expand All @@ -328,15 +372,45 @@
label "Min"
type float
joinnext
default { "0" }
range { -10 10 }
default { "1" }
range { 0 2 }
}
parm {
name "fabric_thread_twist_random_max"
label "Max"
type float
default { "1" }
range { 0 2 }
}
parm {
name "Randomize_Twist_Thread_Offset"
label "Randomize Twist Offset"
type label
joinnext
default { "" }
}
parm {
name "fabric_thread_twist_offset_random_seed"
label "Seed"
type float
joinnext
default { "0" }
range { -10 10 }
range { 0 10 }
}
parm {
name "fabric_thread_twist_offset_random_min"
label "Min"
type float
joinnext
default { "0" }
range { -360 360 }
}
parm {
name "fabric_thread_twist_offset_random_max"
label "Max"
type float
default { "0" }
range { -360 360 }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ Transfer Attributes:
Fiber settings refer to settings per actual output curve. The term `fiber` is synonymous with the term `output curve`.

=== General ===
Automatically Resample Fiber:
Automatically Resample Fiber:
#id: LYNX_fabric_thread_fiber_general_resample
This auto resamples the input curves to account for the [Twist Cycles|#LYNX_fabric_thread_thread_twist_twist]. The `Segments Per 360` parameter controls how many segments are created for every 360 twists.
:warning:
When enabling this the resampling only takes the thread twist settings into account and not the fiber twist settings when calculating the resample density.
Detangle Fiber:
#id: LYNX_fabric_thread_fiber_general_detangle
Detangle the curves after they have been extruded around the input curves. Higher iterations yield better results. The detangling is only done on the [Rest Frame|#LYNX_fabric_rest_frame].
Expand All @@ -60,12 +63,12 @@ Smooth:
These settings control how each output curve is twisted around the orginal curve.

==== > Randomize ====
Randomize the rotation offset per fiber. This is useful to break up the look and to introduce irregularities.
Randomize the twist cycles and twist offset per fiber. This is useful to break up the look and to introduce irregularities. Using small values is recommended.

Seed:
Sets the seed per fiber used for generating a random value between 0 and 1.
Min/Max:
Remaps the random value to this range and adds it to the twist offset.
Remaps the random value to this range and multiplies it with the twist cycle count / adds it to the twist offset.

=== Offset ===
These settings control how each output curve is offset to the orginal curve.
Expand Down Expand Up @@ -104,13 +107,13 @@ Offset:
This offsets the twist of the whole thread around the input curves.

==== > Randomize ====
Randomize the rotation offset per thread. This is useful to break up the look and to introduce irregularities.
Randomize the twist cycles and twist offset per thread. This is useful to break up the look and to introduce irregularities.

Seed:
Sets the seed per thread used for generating a random value between 0 and 1.
Sets the seed per fiber used for generating a random value between 0 and 1.
Min/Max:
Remaps the random value to this range and adds it to the cycle offset.

Remaps the random value to this range and multiplies it with the twist cycle count / adds it to the twist offset.
==== > Scale ====
Apply Scale After Twist:
If a scale attribute is present on the input curves, this will influence if the scale attribute is applied before or after the twist. This can be useful for "flat" threads.
Expand Down

0 comments on commit aa12410

Please sign in to comment.